-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnnetFRloadData.py
More file actions
70 lines (56 loc) · 1.62 KB
/
nnetFRloadData.py
File metadata and controls
70 lines (56 loc) · 1.62 KB
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
62
63
64
65
66
67
68
69
70
# -*- coding: utf-8 -*-
"""
The goal of this file is to compare fractional and normal Neural Networks
@author: Sharjeel Abid Butt
@References
1.
"""
#import mnist_load as mload
#import copy
import dill
import numpy as np
#import scipy as sp
#import scipy.stats as stats
import pandas as pd
#import matplotlib as mpl
import matplotlib.pyplot as plt
#from scipy.special import gamma
def tic():
#Homemade version of matlab tic and toc functions
import time
global startTime_for_tictoc
startTime_for_tictoc = time.time()
def toc():
import time
if 'startTime_for_tictoc' in globals():
print "Elapsed time is " + str(time.time() - startTime_for_tictoc) + " seconds."
else:
print "Toc: start time not set"
# Main Code starts here
filename= 'nnetCE.pkl'
#dill.dump_session(filename)
# and to load the session again:
dill.load_session(filename)
#ind1 = 8
#plt.figure()
#plt.plot(nnClassifier.eV[ind1], label = 'fr = 1')
#plt.hold(True)
#
#for ind2 in range(len(fr)):
# plt.plot(frClassifier[ind1].eV[ind2], label = 'fr = ' + str(fr[ind2]))
#
#plt.hold(False)
#plt.title('Learning rate = ' + str(LRVec[ind1]))
#plt.legend()
#plt.show()
plt.close('all')
for ind1 in range(len(fr)):
plt.figure()
plt.hold(True)
for ind2 in range(len(LRVec)):
plt.plot(nnClassifier.eV[ind2], label = 'NN LR = ' + str(LRVec[ind2]))
plt.plot(frClassifier[ind2].eV[ind1], label = 'frNN LR = ' + str(LRVec[ind2]))
plt.hold(False)
plt.legend()
plt.title('fractional Order = ' + str(LRVec[ind1]))
plt.show()