File size: 498 Bytes
d4c7aae
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# Base Class Layer
class Layer:
    def __init__(self):
        self.input = None
        self.output = None
        self.time_usage = None

    # compute the output of a layer for a given input
    def forward_propagation(self, input):
        raise NotImplementedError

    # conpute dE/dX for a given dE/dY (and update parameters if any)
    def backward_propagation(self, output_error, learning_rate):
        raise NotImplementedError

    def predict(self):
        raise NotImplementedError