Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Deep Finder
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Serpico
Deep Finder
Commits
9a077c05
Commit
9a077c05
authored
3 years ago
by
MOEBEL Emmanuel
Browse files
Options
Downloads
Patches
Plain Diff
Train: added self.loss argument. This makes it more easy to load custom losses.
parent
4b20c6cd
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
deepfinder/training.py
+2
-1
2 additions, 1 deletion
deepfinder/training.py
with
2 additions
and
1 deletion
deepfinder/training.py
+
2
−
1
View file @
9a077c05
...
@@ -158,6 +158,7 @@ class Train(core.DeepFinder):
...
@@ -158,6 +158,7 @@ class Train(core.DeepFinder):
self
.
steps_per_epoch
=
100
self
.
steps_per_epoch
=
100
self
.
steps_per_valid
=
10
# number of samples for validation
self
.
steps_per_valid
=
10
# number of samples for validation
self
.
optimizer
=
Adam
(
lr
=
0.0001
,
beta_1
=
0.9
,
beta_2
=
0.999
,
epsilon
=
1e-08
,
decay
=
0.0
)
self
.
optimizer
=
Adam
(
lr
=
0.0001
,
beta_1
=
0.9
,
beta_2
=
0.999
,
epsilon
=
1e-08
,
decay
=
0.0
)
self
.
loss
=
losses
.
tversky_loss
self
.
flag_direct_read
=
1
self
.
flag_direct_read
=
1
self
.
flag_batch_bootstrap
=
0
self
.
flag_batch_bootstrap
=
0
...
@@ -231,7 +232,7 @@ class Train(core.DeepFinder):
...
@@ -231,7 +232,7 @@ class Train(core.DeepFinder):
# Build network (not in constructor, else not possible to init model with weights from previous train round):
# Build network (not in constructor, else not possible to init model with weights from previous train round):
self
.
net
.
compile
(
optimizer
=
self
.
optimizer
,
loss
=
losses
.
tversky_
loss
,
metrics
=
[
'
accuracy
'
])
self
.
net
.
compile
(
optimizer
=
self
.
optimizer
,
loss
=
self
.
loss
,
metrics
=
[
'
accuracy
'
])
# Load whole dataset:
# Load whole dataset:
if
self
.
flag_direct_read
==
False
:
if
self
.
flag_direct_read
==
False
:
...
...
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