Updated tests and no autograd docs#6
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
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 |
Owner
Author
|
@copilot fix review commentws. |
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.