-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinfo.py
61 lines (47 loc) · 1.45 KB
/
info.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
"""
Deep Spiking Convolutional Neural Network
with STDP Learning Rule on MNIST data
______________________________________________________
Research Internship
Technical University Munich
Creator: Sven Gronauer
Date: February 2018
"""
import argparse
import logging
import numpy as np
import scipy
import matplotlib.pyplot as plt
import pylab
import seaborn as sns
sns.set_style("dark")
import spynnaker8 as s
import pyNN.utility.plotting as plot
from SpikingConvNet import algorithms, classes, utils
from SpikingConvNet.parameters import *
def info(rc, model):
rc.rebuild = True
s.setup(timestep=TIMESTEP)
scnn = classes.Spinnaker_Network(rc,model)
scnn.print_parameters()
s.end()
""" Display Plots
"""
try:
w_1 = scnn.w_layer[1].reshape((-1,model.layers[1].shape[0], model.layers[1].shape[1]))
utils.plot_heatpmap(rc, w_1, title = "Kernel Weights Layer 1")
except:
print("could not plot w_1")
try:
w_2 = scnn.w_layer[2].reshape((-1,model.layers[2].shape[0], model.layers[2].shape[1]))
utils.plot_heatpmap(rc, w_2, title = "Kernel Weights Layer 2")
except:
print("could not plot w_2")
# utils.plot_membran_voltages(v_post_ex, scnn.total_simtime)
utils.plot_heatpmap(rc, scnn.images, title="Input Patterns")
# utils.plot_spikes(spiketrains_post_ex)
plt.show()
""" Test Unit
"""
if __name__ == '__main__':
print ("Test unit")