-
Notifications
You must be signed in to change notification settings - Fork 17
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
Release 0.11.0 #1066
Merged
Release 0.11.0 #1066
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
here, I've implemented Lightning class analogous to previous CNN (many of same functinos) as a subclass of LightningModule. But, I think we might actually want to wrap LightningModule in another class. One reason is that LightningModule.train() is used as a "set_train_mode" functionality, so we can't use train() like we did in CNN. We could use a different name (here train_me()), but it may end up being better to wrap the OPSOLightningModule in another class CNN()/AudioModel/etc. This would avoid the awkwardness of the train_me() function initializing a lightning.Trainer with module=self - I don't know if that's bad or fine but it suggests the opso API goes one level higher and wraps LightningModule missing some essentials like model saving/loading, and getting device mismatches on mps, but generally working
thought I didn't need any "to" calls in lightning but seems they are necessary for hardware-agnostic training https://lightning.ai/docs/pytorch/stable/accelerators/accelerator_prepare.html
only use internal pytorch architectures
resolves Many overlap_fractions don't produce results #945
a few minor changes. Next, going to see how it feels to implement CNN as a class wrapping LightningModule, where LightningModule has the standard Lightning methods and CNN has higher-level API like train() predict() generate_cams()
implemented saving and loading changed default collate function for SafeAudioDataloader to collate_audio_samples, which returns tensors (samples, labels). Can easily initialize with collate_fn=identity or override dl.collate_fn = identity if you want to get back the list of AudioSample objects instead. refactored to have the LightningModule subclass be an attribute of Classifier
with docutils 0.20.1, getting ImportError: cannot import name 'ErrorString' from 'docutils.core'
Suggested [here](#982 (comment)).
…nnotations. This is useful for not having to hardcode these in different methods. I did not, however, change the defintion of `standard_columns` in `from_raven_files(...)` since this was different from `_standard_cols` in the `__init__` function. I wasn't sure if I should change it or not and didn't want to cause unexpected behaviours.
implementing an API where core functionality is shared, then separate classes implement plain PyTorch or Lightning user-facing classes still need to test/debug Lightning api, model saving/loading, and continued trainingtor
note that branch release_0_10_2 was merged into master for the release of v0.10.2. I'm merging master to develop so that when we next try to merge develop to master it's not "behind" the master branch at all. Using develop branch poetry.lock for merge.
includes several security updates recommended by dependabot upgrades wandb min version upgrades black to 24.3 ran black to update style
Issue 855 one hot labels
could not reproduce behavior stated in the issue, added test to confirm
was double counting when multiple instances of class occur on clip and calling labels_on_index(). This behavior might be wanted sometimes for counting labels, but not generally for 0/1 clip labels, so added an argument keep_duplicates with default False so that clip labels are just the set of unique labels unless user passes keep_duplicates=True
resolves provide valid frozen environments (yml) #669
was using list(set(files)) which can result in changing order of files, noticed because tests sometimes failed when assuming order of label df rows was retained
creates a `localize_events_parallel` function and moves most of the input validation in localize_detections to create_candidate_events() where it makes sense for it to be. Now, localize_detections() just wraps create_candidate_events() with localize_events_parallel() and filters the returned events into localized and unlocalized lists. resolves SynchronizedRecorderArray API should allow localizing a list of already-created events #1041 instead of adding a method to SynchronizedRecorderArray, it made more sense to add a function to the spatial_event module: this function is not dependent on anything within the SynchronizedRecorderArray object, it works directly on a list of SpatialEvent objects
resolves add tools for reviewing localized SpatialEvents #981 the full review process should be provided in a notebook, but this may be the only functionality we want to include within opso for now: loads audio clips used to localize a PositionEstimate with offsets based on tdoa, such that the signal should align in time if tdoas are correct. Provides example for visualizing, and test.
resolves add tools for reviewing localized SpatialEvents #981
had only changed one occurrence of list(set(files)), not both, on previous commit throughout code, use unique() function that retains order instead of list(set(x))
Add audiomoth GPS sync tools and refactor localization into modules
instead, call add_representer() during init of class
this avoids missing modules in the documentation for each release, re-build the rst files by first deleting contents of /docs/source then running `sphinx-apidoc -o docs/source opensoundscape -T` from the root dir, and deleting the "opensoundscape packe" heading in /docs/source/opensoundscape.rst
for 0.11.0 release
configure_optimizers uses key "classifier_lr" to create optimizer param group just for params of the .classifier layers adds tests
note that running the training_birdnet_and_perch.ipynb tutorial, I use a different environment. Exported it to opensoundscape_tf.ipynb for convenience.
louisfh
approved these changes
Oct 8, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
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.
Major updates to the API and new features, will document in the release notes