Skip to content

Fix animation input highlighting, guard animation start, and robust image-based output colormap#3

Open
kowshik24 wants to merge 1 commit into
mainfrom
fix/inspect-codebase-for-logical-issues
Open

Fix animation input highlighting, guard animation start, and robust image-based output colormap#3
kowshik24 wants to merge 1 commit into
mainfrom
fix/inspect-codebase-for-logical-issues

Conversation

@kowshik24

Copy link
Copy Markdown
Owner

Motivation

  • Prevent animation errors when the output matrix is absent or invalid and ensure input-region highlighting matches the padded coordinate space used in output calculation.
  • Handle invalid output size scenarios gracefully in the UI instead of trying to render empty matrices.
  • Improve image-based output visualization to avoid divide-by-zero/NaN colors and provide a consistent blue/red colormap for positive/negative activations.

Description

  • Add a guard in startAnimation to return early if outputMatrix is empty or malformed to avoid runtime errors when starting an animation.
  • Change the input-region coordinate math in animateStep to use the padded coordinate space (remove - padding offsets), compute paddedHeight/paddedWidth, and check indices against the padded dimensions when highlighting input cells.
  • Add an early exit in updateVisualization when outputHeight or outputWidth is <= 0 that stops animation, clears matrices, and displays an error message.
  • Replace min/max normalization for image-based output cells with a max-absolute-based intensity normalization to avoid divide-by-zero and produce stable blue-to-red coloring for negative/positive values.

Testing

  • No automated tests were run for this change.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant