-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Paul Ilioaica
committed
Sep 26, 2024
1 parent
186792a
commit d05a6b6
Showing
4 changed files
with
2,730 additions
and
154 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
from nn.linear_layer import LinearLayer | ||
from activation_functions.relu import ReLUActivation | ||
from activation_functions.sigmoid import SigmoidActivation | ||
from normalization.softmax import Softmax | ||
from nn.module import Module | ||
|
||
class SimpleModel(Module): | ||
def __init__(self, input_size, hidden_size, output_size): | ||
self.layer1 = LinearLayer(input_size, hidden_size) | ||
self.layer2 = LinearLayer(hidden_size, output_size) | ||
self.relu = ReLUActivation() | ||
self.sigmoid = SigmoidActivation() | ||
self.softmax = Softmax() | ||
|
||
def __call__(self, x): | ||
x = self.layer1(x) | ||
x = self.relu(x) | ||
x = self.sigmoid(x) | ||
x = self.layer2(x) | ||
return self.softmax(x) |
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
Oops, something went wrong.