Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
Image classification
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Danjou Pierre
Image classification
Commits
1c8a9357
Commit
1c8a9357
authored
7 months ago
by
Danjou Pierre
Browse files
Options
Downloads
Patches
Plain Diff
last update
parent
a13e0c64
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
mlp.py
+1
-1
1 addition, 1 deletion
mlp.py
with
1 addition
and
1 deletion
mlp.py
+
1
−
1
View file @
1c8a9357
...
@@ -23,7 +23,7 @@ def learn_once_mse(w1, b1, w2, b2, data, targets, learning_rate):
...
@@ -23,7 +23,7 @@ def learn_once_mse(w1, b1, w2, b2, data, targets, learning_rate):
a1
=
sigmoid
(
z1
)
# output of the hidden layer (sigmoid activation function)
a1
=
sigmoid
(
z1
)
# output of the hidden layer (sigmoid activation function)
z2
=
np
.
matmul
(
a1
,
w2
)
+
b2
# input of the output layer
z2
=
np
.
matmul
(
a1
,
w2
)
+
b2
# input of the output layer
a2
=
sigmoid
(
z2
)
# output of the output layer (sigmoid activation function)
a2
=
sigmoid
(
z2
)
# output of the output layer (sigmoid activation function)
predictions
=
a2
# the predicted values ar
e
the outputs of the output layer
predictions
=
a2
# the predicted values ar the outputs of the output layer
# Compute loss (MSE)
# Compute loss (MSE)
loss
=
np
.
mean
(
np
.
square
(
predictions
-
targets
))
loss
=
np
.
mean
(
np
.
square
(
predictions
-
targets
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment