Skip to content

Instantly share code, notes, and snippets.

@sccu
sccu / scale.py
Last active January 22, 2019 00:40
Unsaturated scale function in python
from matplotlib import pyplot
import numpy as np
def scale(x, k=1.0, func="log"):
k = max(1e-9, abs(k))
if func == "log":
return np.sign(x) * np.log(k*np.abs(x)+1) / k
elif func == "sqrt":
return np.sign(x) * (np.sqrt(k*np.abs(x)+1) * 2 - 2) / k
else:
@sccu
sccu / Notes for Deep Learning Book.md
Last active July 5, 2018 02:19
Notes for Deep Learning Book

Page 59

Expectation 표기법

         My Formula

Expectation의 선형성

         My Formula

object PoiMapping {
type Poi = Int
type Grade = Int
case class MatchResult(poi: Poi, grade: Grade)
private def searchMatchingCandidates(poi: Poi): Seq[Poi] = 1 to 300 by 3
private def evaluateMatching(p: Poi, c: Poi): Grade = (p - c).abs