Excerpt from this issue: patrick-kidger/diffrax#202
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'Conv' ############################################################################################################################################################# | |
'MaxPool' ################################################################################################################################################# | |
'Relu' ############################################################################################################################################# | |
'Reshape' ################################################################################################################################## | |
'Softmax' ########################################################################################################## | |
'Concat' ################################################################################################## | |
'Add' ######################## |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import jax | |
import iree.compiler as compiler | |
def YOUR_FUNCTION(x): | |
return x + 1 | |
input_sample = [ | |
jax.numpy.array([0.,]) | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
import numpy as np | |
import norse.torch as norse | |
import matplotlib.pyplot as plt | |
import tqdm.notebook as tqdm | |
_ = torch.manual_seed(0) | |
class MyModule(torch.nn.Module): | |
def __init__(self, p=norse.LIFParameters()): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* C implementation of | |
* Yang, Yuning, and Andrew J. Mason. "Hardware efficient automatic | |
* thresholding for NEO-based neural spike detection." IEEE Transactions | |
* on Biomedical Engineering 64.4 (2016): 826-833. | |
* | |
* Writted by Lennart P. L. Landsmeer | |
* NeurocomputingLab, Erasmus MC | |
* */ | |
#include <stdint.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Generated code block BEGIN | |
#define M_PI 3.14159265358979323846 | |
#include <math.h> | |
typedef float * __restrict__ __attribute__((align_value (32))) Table_F32; | |
typedef long long * __restrict__ __attribute__((align_value (32))) Table_I64; | |
typedef union { int i32; float f32; } TypePun_I32F32; typedef char static_assert[ sizeof(int) == sizeof(float) ]; | |
static float EncodeI32ToF32( int i ){ TypePun_I32F32 cast; cast.i32 = i; return cast.f32;} | |
static int EncodeF32ToI32( float f ){ TypePun_I32F32 cast; cast.f32 = f; return cast.i32;} | |
static float stepf( float x ){ if( x < 0 ) return 0; else return 1; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import collections | |
import pandas as pd | |
import matplotlib.pyplot as plt | |
logfile = '<path to benchmark output.dat>' | |
tables = collections.defaultdict(list) | |
def tryfloat(x): | |
# the argument can be a float or |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import arbor | |
import re | |
import subprocess | |
import tempfile | |
import pathlib | |
import matplotlib.pyplot as plt | |
nmodl = ''' | |
NEURON { | |
SUFFIX node |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.pyplot as plt | |
import numba | |
import time | |
NUM_STATE_VARS = 14 | |
def main(): | |
n = 5 | |
s = make_initial_neuron_state(n ** 3, V_soma=None, V_axon=None) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
sys.path.insert(0, '/home/llandsmeer/repos/llandsmeer/arbor/build-debug/prefix/lib/python3.10/site-packages') | |
sys.path.append('/home/llandsmeer/repos/llandsmeer/nmlcc-cat') | |
import arbor | |
import matplotlib.pyplot as plt | |
import nmlcat | |
cat = nmlcat.Catalogue.make() |
NewerOlder