MCPcopy
hub / github.com/tensorflow/playground / regressPlane

Function regressPlane

src/dataset.ts:75–93  ·  view source on GitHub ↗
(numSamples: number, noise: number)

Source from the content-addressed store, hash-verified

73}
74
75export function regressPlane(numSamples: number, noise: number):
76 Example2D[] {
77 let radius = 6;
78 let labelScale = d3.scale.linear()
79 .domain([-10, 10])
80 .range([-1, 1]);
81 let getLabel = (x, y) => labelScale(x + y);
82
83 let points: Example2D[] = [];
84 for (let i = 0; i < numSamples; i++) {
85 let x = randUniform(-radius, radius);
86 let y = randUniform(-radius, radius);
87 let noiseX = randUniform(-radius, radius) * noise;
88 let noiseY = randUniform(-radius, radius) * noise;
89 let label = getLabel(x + noiseX, y + noiseY);
90 points.push({x, y, label});
91 }
92 return points;
93}
94
95export function regressGaussian(numSamples: number, noise: number):
96 Example2D[] {

Callers

nothing calls this directly

Calls 2

randUniformFunction · 0.85
getLabelFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…