• This project
    • Loading...
  • Sign in

Hyunji / CapstoneDesign2021-1

%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
  • CapstoneDesign2021-1
  • lib
  • utils
  • math.py
  • Hyunji's avatar
    math(MSE, MAE) · 1eb0e20c
    1eb0e20c Browse Files
    Hyunji authored 2021-06-21 19:24:39 +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)