Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
seminar-breakout
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Shashank Suhas
seminar-breakout
Commits
6e24b953
Commit
6e24b953
authored
Jan 29, 2017
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change psnr_loss to psnr
parent
6686212e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
tensorpack/tfutils/symbolic_functions.py
tensorpack/tfutils/symbolic_functions.py
+4
-4
No files found.
tensorpack/tfutils/symbolic_functions.py
View file @
6e24b953
...
...
@@ -148,8 +148,8 @@ def get_scalar_var(name, init_value, summary=False, trainable=False):
return
ret
def
psnr
_loss
(
prediction
,
ground_truth
,
name
=
'psnr_loss
'
):
"""
Negative
`Peek Signal to Noise Ratio <https://en.wikipedia.org/wiki/Peak_signal-to-noise_ratio>`_.
def
psnr
(
prediction
,
ground_truth
,
name
=
'psnr
'
):
"""`Peek Signal to Noise Ratio <https://en.wikipedia.org/wiki/Peak_signal-to-noise_ratio>`_.
.. math::
...
...
@@ -163,7 +163,7 @@ def psnr_loss(prediction, ground_truth, name='psnr_loss'):
ground_truth: another :class:`tf.Tensor` with the same shape.
Returns:
A scalar tensor
. The negative PSNR (for minimization)
.
A scalar tensor
representing the PSNR
.
"""
def
log10
(
x
):
...
...
@@ -172,7 +172,7 @@ def psnr_loss(prediction, ground_truth, name='psnr_loss'):
return
numerator
/
denominator
return
tf
.
multiply
(
log10
(
tf
.
reduce_mean
(
tf
.
square
(
prediction
-
ground_truth
))),
10.
,
name
=
name
)
-
10.
,
name
=
name
)
@
contextmanager
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment