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
Muniz Silva Samuel
Image classification
Commits
ff0ad89d
Commit
ff0ad89d
authored
2 years ago
by
Muniz Silva Samuel
Browse files
Options
Downloads
Patches
Plain Diff
Upload New File
parent
13f30386
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
+26
-0
26 additions, 0 deletions
mlp.py
with
26 additions
and
0 deletions
mlp.py
0 → 100644
+
26
−
0
View file @
ff0ad89d
import
numpy
as
np
import
tensorflow
as
tf
import
pandas
as
pd
def
sigm
(
x
):
y
=
1
/
(
1
+
np
.
exp
(
-
x
))
return
y
def
learn_once_mse
(
w1
,
b1
,
w2
,
b2
,
data
,
targests
,
learning_rate
):
return
w1
,
b1
,
w2
,
b2
,
loss
def
one_hot
(
labels
):
oneHotMat
=
np
.
zeros
((
labels
.
size
,
labels
.
size
),
dtype
=
int
)
for
index
,
values
in
enumerate
(
labels
):
oneHotMat
[
index
,
values
]
=
1
return
oneHotMat
def
learn_once_cross_entropy
():
return
print
(
one_hot
(
np
.
array
([
1
,
2
,
0
,
4
,
3
])))
\ No newline at end of file
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