Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
#include "definitionsInternal.h" | |
#include "supportCode.h" | |
extern "C" __global__ void preNeuronResetKernel() { | |
unsigned int id = 32 * blockIdx.x + threadIdx.x; | |
if(id == 0) { | |
dd_glbSpkCntE[0] = 0; | |
} | |
else if(id == 1) { | |
dd_glbSpkCntI[0] = 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
#include <fstream> | |
#include <string> | |
#include <thread> | |
#include <vector> | |
void write(unsigned int thread) | |
{ | |
std::ofstream stream("test_" + std::to_string(thread) + ".txt"); | |
stream << "test" << std::endl; | |
stream << "thread" << std::endl; |
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
{ | |
"cells": [ | |
{ | |
"cell_type": "code", | |
"execution_count": 167, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"import numpy as np\n", | |
"import matplotlib.pyplot as plt\n", |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 os, pathlib | |
import tensorflow as tf | |
from tensorflow.keras import (models, layers, datasets, callbacks, optimizers, | |
initializers, regularizers) | |
from tensorflow.keras.utils import CustomObjectScope | |
from tensorflow.keras.preprocessing.image import ImageDataGenerator | |
from glob import glob | |
import numpy as np | |
# Learning rate schedule |
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++ includes | |
#include <algorithm> | |
#include <fstream> | |
// ------------------------------------------------------------------------ | |
// Helper macro for error-checking CUDA calls | |
#define CHECK_CUDA_ERRORS(call) {\ | |
cudaError_t error = call;\ | |
if (error != cudaSuccess) {\ | |
throw std::runtime_error(__FILE__": " + std::to_string(__LINE__) + ": cuda error " + std::to_string(error) + ": " + cudaGetErrorString(error));\ |
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 | |
spikes = np.loadtxt("spikes.csv", delimiter=",") | |
voltages = np.loadtxt("voltages.csv", delimiter=",") | |
fig, axes = plt.subplots(5, sharex=True) | |
for i in range(4): | |
axes[i].plot(voltages[:,0], voltages[:,i+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 numpy as np | |
from os import path | |
from ml_genn import InputLayer, Layer, SequentialModel | |
from ml_genn.compilers import Compiler | |
from ml_genn.neurons import IntegrateFire, IntegrateFireInput | |
from ml_genn.connectivity import Dense | |
# Load weights | |
weights = [] |
OlderNewer