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)
| 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))) |
nothing calls this directly
no outgoing calls
no test coverage detected