diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-06-04 19:46:57 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-06-04 19:46:57 +0200 |
| commit | 7c72a0d2ced5ce128364b4a1d17696ffa9c3f63c (patch) | |
| tree | c6161bd295839e97b9885082a2fdf2361156be68 /app/client/modules/samplernn/samplernn.loss.js | |
| parent | 521b024439b202be03447188925869100904b807 (diff) | |
denormalize state tree
Diffstat (limited to 'app/client/modules/samplernn/samplernn.loss.js')
| -rw-r--r-- | app/client/modules/samplernn/samplernn.loss.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/client/modules/samplernn/samplernn.loss.js b/app/client/modules/samplernn/samplernn.loss.js index dd6805a..6ca69ef 100644 --- a/app/client/modules/samplernn/samplernn.loss.js +++ b/app/client/modules/samplernn/samplernn.loss.js @@ -41,6 +41,7 @@ class SampleRNNLoss extends Component { const ctx = canvas.getContext('2d') const w = canvas.width = canvas.width * devicePixelRatio const h = canvas.height = canvas.height * devicePixelRatio + ctx.clearRect(0,0,w,h) const keys = Object.keys(lossReport).sort().filter(k => !!lossReport[k].length) let scaleMax = 0 @@ -136,6 +137,13 @@ class SampleRNNLoss extends Component { } }) ctx.stroke() + const i = loss.length-1 + const v = parseFloat(loss[i].training_loss) + const x = lerp((i-2)/(epochsMax/(epochsScaleFactor))*(epochsScaleFactor), wmin, wmax) + const y = lerp(norm(v, scaleMin, scaleMax), hmax, hmin) + const fontSize = 9 + ctx.font = 'italic ' + (fontSize * devicePixelRatio) + 'px "Georgia"' + ctx.fillText(key, x + fontSize, y + fontSize) }) } } |
