Skip to content

Updated tests and no autograd docs#6

Merged
sourcepirate merged 2 commits into
mainfrom
feat/tests
May 31, 2026
Merged

Updated tests and no autograd docs#6
sourcepirate merged 2 commits into
mainfrom
feat/tests

Conversation

@sourcepirate
Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings May 31, 2026 05:12
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR expands neutro’s test coverage across preprocessing, tokenizers, model internals, engine graph nodes, and several layer families, while also emphasizing the project’s no-autograd educational design in docs. It includes one source change to make Dropout report unchanged output shapes.

Changes:

  • Added broad unit coverage for utilities, tokenizers, preprocessing, model helpers, engine nodes, and many layers.
  • Added Dropout.compute_output_shape.
  • Documented the “No Autograd” principle in README, base layer docs, and agent guidelines.

Reviewed changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/utils/test_data_utils.py Adds mocked tests for IMDB dataset utilities.
tests/tokenizers/test_tiktoken_compat.py Adds URL-loading and GPT-2 tokenizer tests.
tests/test_preprocessing.py Adds image augmentation edge-case tests.
tests/test_preprocessing_text.py Adds tokenizer text preprocessing tests.
tests/test_preprocessing_sequence.py Adds pad_sequences behavior and error tests.
tests/models/test_model_coverage.py Adds model graph, fit/evaluate, summary, gradient, and KV-cache coverage.
tests/models/test_model_coverage2.py Adds additional model helper and subclassed model coverage.
tests/layers/pooling/test_global_pooling.py Adds pooling validation and output-shape tests.
tests/layers/normalization/test_batchnorm.py Adds batch normalization inference-state coverage.
tests/layers/embedding/test_time_embedding.py Adds build, shape, 2D, and odd-dimension tests.
tests/layers/core/test_reparameterization.py Adds output-shape and backward-value tests.
tests/layers/core/test_merging_coverage.py Adds merge-layer forward/backward/output-shape tests.
tests/layers/core/test_input_layer.py Adds input layer and symbolic Input tests.
tests/layers/core/test_dropout.py Refactors and expands Dropout tests.
tests/engine/test_node.py Adds KerasTensor and Node tests.
neutro/layers/core/dropout.py Adds compute_output_shape.
README.md Adds no-autograd overview.
docs/layers/base.md Adds no-autograd explanation to layer docs.
Agents.md Adds no-autograd as a core project principle.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +69 to +76
def test_dropout_backward_inference():
layer = Dropout(0.5)
x = np.random.rand(10, 10)
grad = np.random.rand(10, 10)

layer.forward(x, training=False)
dx = layer.backward(grad)
assert np.all(dx == grad)
Comment on lines +16 to +17
def compute_output_shape(self, input_shape):
return input_shape
@sourcepirate
Copy link
Copy Markdown
Owner Author

@copilot fix review commentws.

Copy link
Copy Markdown
Contributor

Copilot AI commented May 31, 2026

@copilot fix review commentws.

Addressed in d71d3d6. I updated the Dropout docs to include compute_output_shape, strengthened the inference-after-training dropout test, and fixed Dropout.forward to clear stale masks on inference so the new coverage passes.

@sourcepirate sourcepirate merged commit efa6275 into main May 31, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants