-
Notifications
You must be signed in to change notification settings - Fork 0
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
initial implementation of DANN #16
Conversation
Do you understand why Domain 0 has that region with no overlap? Does Domain 0 have a higher mass resolution? I'm wondering if those blue points are low mass galaxies. |
Yes, I think so.
Yeah, Domain 0 is |
I see. For DA purposes, we should impose a consistent mass limit across the simulations. DA should not work for the low mass TNG50 galaxies, since they lie below the mass limits of the other simulations, so it's a waste of training. |
A lot better with the new priors: See: |
Looked through the pull request. Everything looks good, although some of the modules may be a bit excessive, haha. |
This pull request introduces significant new functionality to the
haloflow
package, specifically adding a Domain Adversarial Neural Network (DANN) model for domain adaptation tasks. The changes include the addition of new classes and methods for data loading, model definition, training, evaluation, and visualization.New Functionality:
Data Loading:
src/haloflow/dann/data_loader.py
: AddedSimulationDataset
class to handle loading and preprocessing of simulation data, and to provide DataLoaders for training and testing.Model Definition:
src/haloflow/dann/model.py
: AddedDANN
class for the Domain Adversarial Neural Network model, including feature extractor, label predictor, and domain classifier components.Training:
src/haloflow/dann/train.py
: Addedtrain_dann
function to train the DANN model, incorporating both task-specific and domain classification losses.Evaluation:
src/haloflow/dann/evalutate.py
: Addedevaluate_regression
anddomain_accuracy
functions to evaluate the model's regression performance and domain classification accuracy, respectively.Utility:
src/haloflow/dann/utils.py
: AddedGradientReversal
andGradientReversalLayer
classes to implement gradient reversal for adversarial training.Visualization:
src/haloflow/dann/visualise.py
: Added functions to visualize features using t-SNE, includingvisualize_features_fast
andplot_combined_tsne
.