• This project
    • Loading...
  • Sign in

Hyunji / A-Performance-Evaluation-of-CNN-for-Brain-Age-Prediction-Using-Structural-MRI-Data

%ea%b7%b8%eb%a6%bc1
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
  • Files
  • Commits
  • Network
  • Compare
  • Branches
  • Tags
Switch branch/tag
  • A-Performance-Evaluation-of-CNN-for-Brain-Age-Prediction-Using-Structural-MRI-Data
  • 2DCNN
  • lib
  • utils
  • math.py
  • Hyunji's avatar
    math · 55a5d0b9
    55a5d0b9
    Hyunji authored 2021-12-20 04:22:57 +0900
math.py 353 Bytes
Raw Blame History Permalink
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
""" 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)