Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
muPIX
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
sicomp
muPIX
Commits
df49f763
Commit
df49f763
authored
3 months ago
by
Fabrice Daian
Browse files
Options
Downloads
Patches
Plain Diff
update
parent
a37ecacd
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
mupixutils.py
+2
-2
2 additions, 2 deletions
mupixutils.py
with
2 additions
and
2 deletions
mupixutils.py
+
2
−
2
View file @
df49f763
...
...
@@ -190,7 +190,7 @@ def train(d_model, g_model, gan_model, dataset, output_path, val_dataset = None,
val_loss
=
mse
/
((
ssim
+
1
)
/
2
)
# scaling ssim on 0,1 instead of -1,1 : trouble when ssim is <0
with
open
(
output_path
+
"
/log.txt
"
,
'
a
'
)
as
file
:
# file.write("[Loss] Val loss at epoch %d : MSE[%.3e], SSIM[%.3e], Validation_Loss[%.3e]\n"%(current_epoch,mse,ssim,val_loss))
file
.
write
(
"
[Loss] Val loss at epoch
"
,
str
(
current_epoch
)
,
"
: MSE[
"
,
str
(
mse
)
,
"
], SSIM[
"
,
str
(
ssim
)
,
"
], Validation_Loss[
"
,
str
(
val_loss
)
,
"
]
\n
"
)
file
.
write
(
"
[Loss] Val loss at epoch
"
+
str
(
current_epoch
)
+
"
: MSE[
"
+
str
(
mse
)
+
"
], SSIM[
"
+
str
(
ssim
)
+
"
], Validation_Loss[
"
+
str
(
val_loss
)
+
"
]
\n
"
)
if
val_loss
<
best_val_loss
:
best_val_loss
=
np
.
copy
(
val_loss
)
g_model
.
save
(
output_path
+
"
/networks/Generator
"
)
...
...
@@ -214,7 +214,7 @@ def train(d_model, g_model, gan_model, dataset, output_path, val_dataset = None,
else
:
with
open
(
output_path
+
"
/log.txt
"
,
'
a
'
)
as
file
:
# file.write("[Patience]: Reached at epoch %d with best validation loss :[%.3e]\n"%(current_epoch,val_loss))
file
.
write
(
"
[Patience]: Reached at epoch
"
,
str
(
current_epoch
)
,
"
with best validation loss :[
"
,
str
(
val_loss
)
,
"
]
\n
"
)
file
.
write
(
"
[Patience]: Reached at epoch
"
+
str
(
current_epoch
)
+
"
with best validation loss :[
"
+
str
(
val_loss
)
+
"
]
\n
"
)
break
gc
.
collect
()
...
...
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