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
Elkhadri Doha
Image classification
Commits
9b0df479
Commit
9b0df479
authored
1 year ago
by
Elkhadri Doha
Browse files
Options
Downloads
Patches
Plain Diff
Upload New File
parent
efbadabd
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/learn_once_mse_test.py
+21
-0
21 additions, 0 deletions
tests/learn_once_mse_test.py
with
21 additions
and
0 deletions
tests/learn_once_mse_test.py
0 → 100644
+
21
−
0
View file @
9b0df479
from
mlp
import
learn_once_mse
import
numpy
as
np
def
learn_once_mse_test
():
N
=
100
d_in
=
30
d_out
=
1
d_h
=
5
train
=
np
.
random
.
rand
(
N
,
d_in
)
targets
=
np
.
random
.
randint
(
10
,
size
=
(
N
,
d_out
))
w1
=
2
*
np
.
random
.
rand
(
d_in
,
d_h
)
-
1
b1
=
np
.
zeros
((
1
,
d_h
))
w2
=
2
*
np
.
random
.
rand
(
d_h
,
d_out
)
-
1
b2
=
np
.
zeros
((
1
,
d_out
))
w1
,
b1
,
w2
,
b2
,
loss
=
learn_once_mse
(
w1
,
b1
,
w2
,
b2
,
train
,
targets
,
learning_rate
=
0.01
)
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