Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
python
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
Releases
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
Tom Rink
python
Commits
9db25adf
Commit
9db25adf
authored
1 year ago
by
tomrink
Browse files
Options
Downloads
Patches
Plain Diff
snapshot...
parent
1badb814
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/GSOC/E2_ESRGAN/lib/train.py
+3
-0
3 additions, 0 deletions
modules/GSOC/E2_ESRGAN/lib/train.py
with
3 additions
and
0 deletions
modules/GSOC/E2_ESRGAN/lib/train.py
+
3
−
0
View file @
9db25adf
...
@@ -99,6 +99,7 @@ class Trainer(object):
...
@@ -99,6 +99,7 @@ class Trainer(object):
# loss = loss_mae
# loss = loss_mae
loss
=
loss_mse
loss
=
loss_mse
mean_loss
=
metric
(
loss_mae
)
mean_loss
=
metric
(
loss_mae
)
mse_metric
(
loss
)
psnr_metric
(
tf
.
reduce_mean
(
tf
.
image
.
psnr
(
fake
,
image_hr
,
max_val
=
PSNR_MAX
)))
psnr_metric
(
tf
.
reduce_mean
(
tf
.
image
.
psnr
(
fake
,
image_hr
,
max_val
=
PSNR_MAX
)))
# gen_vars = list(set(generator.trainable_variables))
# gen_vars = list(set(generator.trainable_variables))
gen_vars
=
generator
.
trainable_variables
gen_vars
=
generator
.
trainable_variables
...
@@ -119,6 +120,7 @@ class Trainer(object):
...
@@ -119,6 +120,7 @@ class Trainer(object):
print
(
'
start epoch #:
'
,
epoch
)
print
(
'
start epoch #:
'
,
epoch
)
metric
.
reset_states
()
metric
.
reset_states
()
psnr_metric
.
reset_states
()
psnr_metric
.
reset_states
()
mse_metric
.
reset_states
()
for
image_lr
,
image_hr
in
self
.
dataset
:
for
image_lr
,
image_hr
in
self
.
dataset
:
num_steps
=
train_step
(
image_lr
,
image_hr
)
num_steps
=
train_step
(
image_lr
,
image_hr
)
...
@@ -149,6 +151,7 @@ class Trainer(object):
...
@@ -149,6 +151,7 @@ class Trainer(object):
"
\t
PSNR: {}
\t
Time Taken: {} sec
"
.
format
(
"
\t
PSNR: {}
\t
Time Taken: {} sec
"
.
format
(
num_steps
,
num_steps
,
metric
.
result
(),
metric
.
result
(),
mse_metric
.
result
(),
psnr_metric
.
result
(),
psnr_metric
.
result
(),
time
.
time
()
-
time
.
time
()
-
start_time
))
start_time
))
...
...
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