Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hyunji
/
A-Performance-Evaluation-of-CNN-for-Brain-Age-Prediction-Using-Structural-MRI-Data
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-12-20 04:22:57 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
55a5d0b93c7bfb5700c97a01252d87c7f6c55823
55a5d0b9
1 parent
942e3478
math
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
2DCNN/lib/utils/math.py
2DCNN/lib/utils/math.py
0 → 100644
View file @
55a5d0b
""" 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