This file contains hidden or 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
from OpenGL.GL import * | |
from OpenGL.GLUT import * | |
import numpy as np | |
import matplotlib.pyplot as plt | |
# Global variables | |
shaderProgram = None | |
vertexBufferObject = None | |
indexBufferObject = None | |
framebufferObject = None |
This file contains hidden or 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 | |
os.environ["QT_API"] = "pyqt" | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from mayavi import mlab | |
if __name__ == "__main__": | |
# Create a test 100x100 RGB image: all black and a red border. This is to demonstrate how to align the viewport. | |
img = np.zeros((100, 100, 3), dtype = np.uint8) |
This file contains hidden or 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
%% Non-homogenous Poisson spike train in a spiking neural network framework | |
% We generate inhomogenous Poisson spike trains for a set of output neurons | |
% in a spiking neural network. We use the "thinning" approach introduced in | |
% "Simulation of nonhomogeneous poisson processes by thinning" by Lewis and | |
% Shedler (1979). | |
% Number of output neurons | |
numOut = 10; | |
% Define a supremum for lambda(t). I.e., this should be the smallest upper |
This file contains hidden or 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
%% Ornstein-Uhlenbeck Process | |
% ...from the paper "FLUCTUATING SYNAPTIC CONDUCTANCES RECREATE IN | |
% VIVO-LIKE ACTIVITY IN NEOCORTICAL NEURONS" | |
% The stochastic differential equation is given by: | |
% dx/dt = 1/tau * (mu - x) + sqrt(D) * chi(t) | |
% where: | |
% x is the random variable | |
% D is the amplitude of the stochastic component | |
% chi(t) is a normally-distributed (zero-mean) noise source | |
% tau is the time constant (tau = 0 gives white noise, tau > 0 gives |