Claude/standalone implementation setup 01 bq mf5 x wm l8y fx ju h dcvd z9 - #29
Open
nnknk0802 wants to merge 5 commits into
Conversation
This commit introduces a clean interface for the SSSD-ECG diffusion model: New Features: - model_wrapper.py: SSSDECG class with simplified API - model(x, y) for training loss computation - model.generate() for sample generation - Built-in checkpoint save/load functionality - dataset.py: Dedicated Dataset classes - ECGDataset: Generic ECG dataset class - PTBXLDataset: PTB-XL specific dataset - create_dataloaders(): Utility function for easy DataLoader creation - train_new.py: Clean training script using new interface - Progress tracking with tqdm - Flexible configuration via command line or JSON - Better checkpoint management - example_usage.py: Comprehensive usage examples - Basic training loop - Sample generation - Checkpoint operations - Real data handling - README_REFACTORED.md: Japanese documentation - API reference - Usage examples - Troubleshooting guide Benefits: - Cleaner separation of concerns (data, model, training) - Easier to use and extend - Better code organization - Original implementation remains unchanged
…ader-01FjNF9yHomAMfj5bjHrSeNF Refactor SSSD-ECG: Separate data loading from model implementation
Create a standalone, self-contained implementation of SSSD-ECG that can be easily copied to other projects. Structure: - sssd_standalone/: Main package directory - model_wrapper.py: Clean API wrapper for SSSDECG model - dataset.py: Dataset classes (ECGDataset, PTBXLDataset) - models/: Model implementations (SSSD_ECG, S4Model) - utils/: Utility functions for diffusion, training, sampling - config/: Configuration file (config_SSSD_ECG.json) - examples/: Training and usage examples - README.md: Comprehensive documentation - requirements.txt: Dependencies Features: - Simple API for training and inference - Modular design with separated components - Well-documented with usage examples - Easy to integrate into other projects - Includes parameter configuration file
- Replace pytorch_lightning.utilities.rank_zero_only with simple local implementation - Add missing dependencies (einops, opt_einsum) to requirements.txt - This makes the standalone implementation truly independent without heavy dependencies The rank_zero_only decorator is now a simple pass-through function for standalone usage. For distributed training, users can modify this decorator as needed.
- Add setup.py for pip installation support - Add MANIFEST.in for package distribution - Add example_external_usage.py demonstrating 3 import methods - Update README with detailed installation instructions Users can now: 1. Install as package: pip install -e . 2. Use sys.path in external projects 3. Set PYTHONPATH environment variable This makes sssd_standalone easier to integrate into other projects.
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.