Skip to content
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
merged 300 commits into from
Oct 8, 2024
Merged

Release 0.11.0 #1066

merged 300 commits into from
Oct 8, 2024

Conversation

sammlapp
Copy link
Collaborator

@sammlapp sammlapp commented Oct 8, 2024

Major updates to the API and new features, will document in the release notes

sammlapp and others added 30 commits May 24, 2024 12:25
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'
…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
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
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.
Copy link
Member

@louisfh louisfh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@sammlapp sammlapp merged commit 1b3e121 into master Oct 8, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants