Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hyunji
/
CapstoneDesign2021-1
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Hyunji
2021-06-21 19:24:39 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
1eb0e20ca3416d2d902ffdf4e35d43430cf915fa
1eb0e20c
1 parent
2eee2f8d
math(MSE, MAE)
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
lib/utils/math.py
lib/utils/math.py
0 → 100644
View file @
1eb0e20
""" Mathematical formulae for different expressions"""
import
torch
from
.torch_utils
import
EPSILON
def
echo_mi
(
f
,
s
):
N
=
s
.
shape
[
0
]
s
=
s
.
view
(
N
,
-
1
)
return
-
torch
.
log
(
torch
.
abs
(
s
)
+
EPSILON
)
.
sum
(
dim
=
1
)
def
get_echo_clip_factor
(
num_samples
):
max_fx
=
1
d_max
=
num_samples
return
(
2
**
(
-
23
)
/
max_fx
)
**
(
1.0
/
d_max
)
Please
register
or
login
to post a comment