Skip to content

Commit e845aa4

Browse files
committed
TopkSamples; Consistent color scale for layer and neuron
1 parent d11b40e commit e845aa4

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

react/src/topk/TopkSamples.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ export function TopkSamples({
1717
zerothDimensionLabels,
1818
firstDimensionLabels
1919
}: TopkSamplesProps) {
20-
// Obtain min and max activations for a consistent color scale across all samples
21-
const [minValue, maxValue] = minMaxInNestedArray(activations);
22-
2320
const numberOfLayers = activations.length;
2421
const numberOfNeurons = activations[0].length;
2522
const numberOfSamples = activations[0][0].length;
@@ -46,6 +43,11 @@ export function TopkSamples({
4643
return tokens[layerNumber][neuronNumber][sampleNumber];
4744
});
4845

46+
// For a consistent color scale across all samples in this layer and neuron
47+
const [minValue, maxValue] = minMaxInNestedArray(
48+
activations[layerNumber][neuronNumber]
49+
);
50+
4951
const selectRowStyle = {
5052
paddingTop: 5,
5153
paddingBottom: 5

0 commit comments

Comments
 (0)