Conversation
added 3 commits
May 14, 2026 16:27
perf(inference): replace nested Python loop with vectorised NumPy indexing
- scipy maximum_filter computes NaN-neighbourhood mask in one C pass
- Advanced indexing gathers all patches simultaneously (no Python loop)
- Estimated speedup: ~30 min -> ~2 min on 3660x3438 image
- test_predict_vectorized.py: 7 tests validating shape, dtype, NaN
exclusion, border exclusion, numerical match vs. loop reference
fix(train): refit RobustScaler on training split for each new dataset
- Fitting scaler on train_flat pixels before patch extraction
- Saves robust_scaler.pkl alongside model weights in output_dir
- Resolves incorrect scaling when training with a different image
refactor(src): delete 6 empty stub files from spectralcrop/
- Removed: make_dataset.py, generate_features.py, predict_model.py,
train_model.py, backtesting.py, visualize.py (all 0 KB)
test: add test_preprocessing.py and test_training_loop.py
- Coverage: 18% -> 40%
- test_preprocessing: nearest band lookup, add_vegetation_indices
with synthetic zarr (zarr.open_group + dimension_names pattern)
- test_training_loop: fit_cnn2d runs, eval mode, early stopping,
loss decrease on separable data
feat(dvc): add dvc.yaml declarative pipeline + params.yaml
- 5 stages: preprocess, make_labels, make_split, train, evaluate
- deps/outs/params declared for each stage
- `dvc repro` reruns only outdated stages
docs: add GCP deployment proposal (docs/gcp_deployment_proposal.md)
- Cloud Run Jobs (batch 9.5 GB images) + Cloud Run Service (REST API)
- Cost estimate, Terraform snippet, 4-sprint implementation plan
- Add --output-metrics option (default: reports/metrics_retrain.json)
- Output format: {split: {metric: value}} compatible with dvc metrics diff
- Update dvc.yaml evaluate stage to pass --output-metrics explicitly
- dvc repro + dvc metrics diff now fully functional end-to-end
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.