Skip to content

Commit

Permalink
TopkSamples; Consistent color scale for layer and neuron
Browse files Browse the repository at this point in the history
  • Loading branch information
danbraunai committed Feb 20, 2023
1 parent d11b40e commit e845aa4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions react/src/topk/TopkSamples.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ export function TopkSamples({
zerothDimensionLabels,
firstDimensionLabels
}: TopkSamplesProps) {
// Obtain min and max activations for a consistent color scale across all samples
const [minValue, maxValue] = minMaxInNestedArray(activations);

const numberOfLayers = activations.length;
const numberOfNeurons = activations[0].length;
const numberOfSamples = activations[0][0].length;
Expand All @@ -46,6 +43,11 @@ export function TopkSamples({
return tokens[layerNumber][neuronNumber][sampleNumber];
});

// For a consistent color scale across all samples in this layer and neuron
const [minValue, maxValue] = minMaxInNestedArray(
activations[layerNumber][neuronNumber]
);

const selectRowStyle = {
paddingTop: 5,
paddingBottom: 5
Expand Down

0 comments on commit e845aa4

Please sign in to comment.