MCPcopy Create free account
hub / github.com/subbarayudu-j/TheAlgorithms-Python / __init__

Method __init__

neural_network/bpnn.py:33–48  ·  view source on GitHub ↗

common connected layer of bp network :param units: numbers of neural units :param activation: activation function :param learning_rate: learning rate for paras :param is_input_layer: whether it is input layer or not

(self,units,activation=None,learning_rate=None,is_input_layer=False)

Source from the content-addressed store, hash-verified

31 Layers of BP neural network
32 '''
33 def __init__(self,units,activation=None,learning_rate=None,is_input_layer=False):
34 '''
35 common connected layer of bp network
36 :param units: numbers of neural units
37 :param activation: activation function
38 :param learning_rate: learning rate for paras
39 :param is_input_layer: whether it is input layer or not
40 '''
41 self.units = units
42 self.weight = None
43 self.bias = None
44 self.activation = activation
45 if learning_rate is None:
46 learning_rate = 0.3
47 self.learn_rate = learning_rate
48 self.is_input_layer = is_input_layer
49
50 def initializer(self,back_units):
51 self.weight = np.asmatrix(np.random.normal(0,0.5,(self.units,back_units)))

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected