mirror of
https://hub.njuu.cf/TheAlgorithms/Python.git
synced 2023-10-11 13:06:12 +08:00
Fix spelling in neural_network/convolution_neural_network.py (#849)
* Fix spelling in neural_network/convolution_neural_network.py * fix import Signed-off-by: cedric.farinazzo <cedric.farinazzo@epita.fr>
This commit is contained in:
parent
fc95e7a91a
commit
9037abae11
@ -17,6 +17,7 @@
|
|||||||
'''
|
'''
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
|
|
||||||
|
import pickle
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import matplotlib.pyplot as plt
|
import matplotlib.pyplot as plt
|
||||||
|
|
||||||
@ -50,7 +51,6 @@ class CNN():
|
|||||||
|
|
||||||
def save_model(self, save_path):
|
def save_model(self, save_path):
|
||||||
#save model dict with pickle
|
#save model dict with pickle
|
||||||
import pickle
|
|
||||||
model_dic = {'num_bp1':self.num_bp1,
|
model_dic = {'num_bp1':self.num_bp1,
|
||||||
'num_bp2':self.num_bp2,
|
'num_bp2':self.num_bp2,
|
||||||
'num_bp3':self.num_bp3,
|
'num_bp3':self.num_bp3,
|
||||||
@ -73,7 +73,6 @@ class CNN():
|
|||||||
@classmethod
|
@classmethod
|
||||||
def ReadModel(cls, model_path):
|
def ReadModel(cls, model_path):
|
||||||
#read saved model
|
#read saved model
|
||||||
import pickle
|
|
||||||
with open(model_path, 'rb') as f:
|
with open(model_path, 'rb') as f:
|
||||||
model_dic = pickle.load(f)
|
model_dic = pickle.load(f)
|
||||||
|
|
||||||
@ -190,7 +189,7 @@ class CNN():
|
|||||||
pd_all.append(pd_conv2)
|
pd_all.append(pd_conv2)
|
||||||
return pd_all
|
return pd_all
|
||||||
|
|
||||||
def trian(self,patterns,datas_train, datas_teach, n_repeat, error_accuracy,draw_e = bool):
|
def train(self, patterns, datas_train, datas_teach, n_repeat, error_accuracy, draw_e = bool):
|
||||||
#model traning
|
#model traning
|
||||||
print('----------------------Start Training-------------------------')
|
print('----------------------Start Training-------------------------')
|
||||||
print((' - - Shape: Train_Data ',np.shape(datas_train)))
|
print((' - - Shape: Train_Data ',np.shape(datas_train)))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user