forked from tensorflow/minigo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathheat_map.js
More file actions
32 lines (32 loc) · 961 Bytes
/
Copy pathheat_map.js
File metadata and controls
32 lines (32 loc) · 961 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
define(["require", "exports"], function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function heatMapDq(qs) {
let result = [];
qs.forEach((q) => {
let rgb = q > 0 ? 0 : 255;
let a = Math.min(Math.abs(q / 100), 0.6);
result.push(new Float32Array([rgb, rgb, rgb, a]));
});
return result;
}
exports.heatMapDq = heatMapDq;
function heatMapN(ns) {
let result = [];
let nSum = 0;
ns.forEach((n) => {
nSum += n;
});
nSum = Math.max(nSum, 1);
ns.forEach((n) => {
let a = Math.min(Math.sqrt(n / nSum), 0.6);
if (a > 0) {
a = 0.1 + 0.9 * a;
}
result.push(new Float32Array([0, 0, 0, a]));
});
return result;
}
exports.heatMapN = heatMapN;
});
//# sourceMappingURL=heat_map.js.map