-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ptychopinn devel4 #76
Open
hoidn
wants to merge
5
commits into
AdvancedPhotonSource:master
Choose a base branch
from
hoidn:ptychopinn_devel4
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains 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
…uctor We've made several updates to the PtychoPINNTrainableReconstructor class in the Ptychodus project to better prepare and use training data for the PtychoPINN model. These changes make the training process more straightforward and effective by improving how we load data and ensuring everything is set up correctly before training starts. Key Updates: - **Better Data Loading**: We now use `loader.PtychoDataContainer.from_raw_data_without_pc` to load training data more efficiently. This method simplifies loading diffraction patterns, scan coordinates, and probe guesses, making the process faster and more direct. - **Using Ground Truth Objects**: Instead of using object patches, we've switched to using the full ground truth object for the `objectGuess` parameter. This gives the model a more accurate starting point, which can help with training. - **Handling Probe Guesses Correctly**: We've fixed how we handle probe guesses by using the `probeArray` from the `ReconstructInput`. This ensures the model starts with a proper probe guess. - **Checking Data Before Training**: We added checks in the `train()` method to make sure training data is loaded before we start training. This prevents errors from trying to train without data. - **Clearer Documentation**: We've updated the comments and documentation in the `train()` method to better reflect these changes and help guide future work. - **Making Sure Data is Loaded**: There's now a check to confirm `ingestTrainingData` has been called before training begins, ensuring all necessary data is ready. - **Code Cleanups**: We've cleaned up the code in related areas to make it easier to read and work with, setting a good foundation for future updates. These updates improve how the PtychoPINNTrainableReconstructor class handles training data, making the training process more reliable and easier to manage.
…I/backend integration - **error resolution in model layer**: fixed pyright errors in `ptychopinn/model.py` by adding `setGridSize`, `setStateFilePath`, and `getStateFilePath` to `PtychoPINNModelPresenter`. This ensures model-view synchronization, aligning the presenter with `PtychoPINNModelParametersController` requirements for model state and parameter sync. - **PtychoPINNReconstructorLibrary development**: enhanced the PtychoPINN ecosystem with the `PtychoPINNReconstructorLibrary`: - initialized `PtychoPINNModelSettings` and `PtychoPINNTrainingSettings` for reconstruction configuration. - created specific reconstructor instances for PtychoPINN algorithms. - introduced conditional inclusion for reconstructors based on dependencies and developer mode. - established an observation mechanism for settings changes, promoting adaptability. - adhered to the `ReconstructorLibrary` interface for consistency across reconstructor libraries. - **GUI and backend logic integration**: - developed `PtychoPINNModelPresenter` and `PtychoPINNTrainingPresenter` for GUI-based settings management. - introduced view components for PtychoPINN settings for user interface improvements. - implemented controllers for UI and model layer communication, ensuring state consistency. - added a ViewController Factory for efficient view-controller management. - integrated `PtychoPINNReconstructorLibrary` into the codebase with initialization routines for model and training settings. - **code refactoring for data ingestion**: refactored `ingestTrainingData` with a helper function for better code readability and maintainability. This improves data processing efficiency, supporting `PtychoDataContainer` generation for reconstruction tasks. - **misc**: - Added PtychoPinnTrainingAutomationDatasetWorkflow equivalent to PtychoNNTrainingAutomationDatasetWorkflow for the ptychopinn backend. - Added a manual on implementing and using HDF5 file loaders based on the repository's file reader interfaces. - Added a headless start script to load HDF5 diffraction data and train the ptychopinn model backend. - stub out PtychoPINN workflow
'ptycho' is the ptychopinn package dependency. I'll poke around to understand what you did to handle missing backends gracefully and try to repeat it with the ptychoPINN dependency |
Ok, with the fix to that init.py I'm able to run ptychodus without the pinn backend on my environment |
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.
This completes the PtychoPINN reconstructor backend. To test it, we will need a new hdf5 loader. Some GUI debugging is also required.