tdce-basic / model /layer.py
Tin Theethawat Savastham
♻️ Split Function for Implement and Model Directory
4ec8622
Raw
History Blame Contribute Delete
498 Bytes
# 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