(displayActivations, networkActivations = displayActivations, preActivations = null)
| 2772 | } |
| 2773 | |
| 2774 | update(displayActivations, networkActivations = displayActivations, preActivations = null) { |
| 2775 | this.lastDisplayActivations = displayActivations; |
| 2776 | this.lastNetworkActivations = networkActivations; |
| 2777 | this.lastPreActivations = preActivations; |
| 2778 | this.layerMeshes.forEach((layer, layerIndex) => { |
| 2779 | const values = displayActivations[layerIndex]; |
| 2780 | if (!values) return; |
| 2781 | const scale = layerIndex === 0 ? 1 : maxAbsValue(displayActivations[layerIndex]); |
| 2782 | this.applyNodeColors(layer, values, scale || 1, layerIndex); |
| 2783 | }); |
| 2784 | |
| 2785 | this.connectionGroups.forEach((group) => { |
| 2786 | const sourceValues = networkActivations[group.sourceLayer]; |
| 2787 | if (!sourceValues) return; |
| 2788 | this.applyConnectionColors(group, sourceValues); |
| 2789 | }); |
| 2790 | if (this.selectedNeuron) { |
| 2791 | this.updateSelectionVisuals(); |
| 2792 | } else if (typeof this.focusChangeCallback === "function" && this.currentSelectionDetail !== null) { |
| 2793 | this.currentSelectionDetail = null; |
| 2794 | this.focusChangeCallback(null); |
| 2795 | } |
| 2796 | if (typeof this.requestRender === "function") { |
| 2797 | this.requestRender(); |
| 2798 | } |
| 2799 | } |
| 2800 | |
| 2801 | applyNodeColors(layer, values, scale, layerIndex) { |
| 2802 | const { mesh, type } = layer; |
no test coverage detected