(network: nn.Node[][], container)
| 401 | } |
| 402 | |
| 403 | function updateWeightsUI(network: nn.Node[][], container) { |
| 404 | for (let layerIdx = 1; layerIdx < network.length; layerIdx++) { |
| 405 | let currentLayer = network[layerIdx]; |
| 406 | // Update all the nodes in this layer. |
| 407 | for (let i = 0; i < currentLayer.length; i++) { |
| 408 | let node = currentLayer[i]; |
| 409 | for (let j = 0; j < node.inputLinks.length; j++) { |
| 410 | let link = node.inputLinks[j]; |
| 411 | container.select(`#link${link.source.id}-${link.dest.id}`) |
| 412 | .style({ |
| 413 | "stroke-dashoffset": -iter / 3, |
| 414 | "stroke-width": linkWidthScale(Math.abs(link.weight)), |
| 415 | "stroke": colorScale(link.weight) |
| 416 | }) |
| 417 | .datum(link); |
| 418 | } |
| 419 | } |
| 420 | } |
| 421 | } |
| 422 | |
| 423 | function drawNode(cx: number, cy: number, nodeId: string, isInput: boolean, |
| 424 | container, node?: nn.Node) { |
no outgoing calls
no test coverage detected
searching dependent graphs…