{{ message }}

Instantly share code, notes, and snippets.

# Aidan Rocke AidanRocke

Created Nov 30, 2019
SORF
View fx.c
 #include "fx.h" #include #include #include #include void static inline wht_butterfly(float * const s, float * const d) { float temp = *s; *s += *d; *d = temp - *d;
Created Jun 8, 2018
Find simplest google translate request that generate the maximum number of unique words
 from googletrans import Translator from itertools import product from pandas import DataFrame, read_csv import numpy as np import string import time import os # Get google translator object translator = Translator()
Last active Oct 21, 2020
Complex step example
View complex_step_example.m
 % Complex step example. Requires Symbolic Math Toolbox. format long syms x; f = atan(x)/(1+exp(-x^2)) % Derivative at \$a = 2\$: a = 2; fd = double(subs( diff(f), a)) % Convert symbolic function to MATLAB function. f = matlabFunction(f);
Created Apr 21, 2018
Complex step approximation to derivative.
View complex_step.m
 function fd = complex_step(f,x,h) %COMPLEX_STEP Complex step approximation to derivative. % fd = COMPLEX_STEP(f,x,h) computes the complex step approximation % fd to the derivative of f at x, using step h (default 1e-100). if nargin < 3, h = 1e-100; end fd = imag( f(x + sqrt(-1)*h) )/h;
Last active Mar 12, 2020
TensorFlow Scope Decorator
View blog_tensorflow_scope_decorator.py
 # Working example for my blog post at: # https://danijar.github.io/structuring-your-tensorflow-models import functools import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data def doublewrap(function): """ A decorator decorator, allowing to use the decorator to be used without
Last active Apr 16, 2021
Very simple ray tracing engine in (almost) pure Python. Depends on NumPy and Matplotlib. Diffuse and specular lighting, simple shadows, reflections, no refraction. Purely sequential algorithm, slow execution.
View raytracing.py
 """ MIT License Copyright (c) 2017 Cyrille Rossant Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is