10000 Add implementation of the multi-layer perceptron classifier from scratch by duuan · Pull Request #12756 · TheAlgorithms/Python · GitHub
[go: up one dir, main page]

Skip to content

Add implementation of the multi-layer perceptron classifier from scratch #12756

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
Update multilayer_perceptron_classifier_from_scratch.py
  • Loading branch information
duuan authored May 14, 2025
commit a7a4e780c94e4e76f9d25b785d76c28916889417
Original file line number Diff line number Diff line change
Expand Up @@ -142,15 +142,15 @@
self.gamma = gamma # learning_rate decay hyperparameter gamma
self.epoch = epoch
self.hidden_dim = hidden_dim

self.train_loss = []
self.train_accuracy = []
self.test_loss = []
self.test_accuracy = []

Check failure on line 145 in machine_learning/multilayer_perceptron_classifier_from_scratch.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (W293)

machine_learning/multilayer_perceptron_classifier_from_scratch.py:145:1: W293 Blank line contains whitespace
self.train_loss: list[float] = []
self.train_accuracy: list[float] = []
self.test_loss: list[float] = []
self.test_accuracy: list[float] = []

self.dataloader = dataloader
self.inter_variable = {}
self.weights1_list = []
self.inter_variable: dict[str, np.ndarray] = {}
self.weights1_list: list[np.ndarray] = []

def get_inout_dim(self) -> tuple[int, int]:
"""
Expand Down Expand Up @@ -469,7 +469,8 @@

w1, w2 = self.initialize()

test_accuracy_list, test_loss_list = [], []
test_accuracy_list: list[float] = []
test_loss_list: list[float] = []

batch_size = 1

Expand Down
Loading
0