Last active
May 30, 2020 17:16
-
-
Save SkalskiP/8c61fdfe011fa89e827f331fca29aaaa to your computer and use it in GitHub Desktop.
Sequential Model
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def train( | |
self, x_train: np.array, y_train: np.array, | |
epochs: int, batch_size: int = 64, | |
) -> None: | |
for epoch in range(epochs): | |
for x_batch, y_batch in generate_batches(x_train, y_train, batch_size): | |
y_hat_batch = self._forward(x_batch) | |
activation = y_hat_batch - y_batch | |
self._backward(activation) | |
self._update() | |
def predict(self, x: np.array) -> np.array: | |
return self._forward(x) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment