-
Notifications
You must be signed in to change notification settings - Fork 35
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
StarNet -- An Inference method for Population III star formation and feedback #377
base: main
Are you sure you want to change the base?
Conversation
Not working fully -- get NaNs and segfaults
…e in StarFind and FBNet, along with txt files containing distribution functions relevent to FBNet that were generated using the PHX simulations
…lso introduced EnzoObjectFeedbackSphere class to store positions, radii, metal_yields, etc. for SN remnants
…e feedbackspheres are only sent to blocks that contribute to the level array
… to EnzoSimulation object
…blocks aren't calling compute_done()
Multiplying radius by factor of 0.2 to correct for overestimations from PHX Tweaked metallicity scaling
Not seeding RNG before every call to rand() anymore so that it doesn't just return the same number over and over again Added another filtering criterion that checks the mean overdensity of the block, rather than cell-wise overdensity
…der, regardless of the order of Group:inference:field_list
…es to EnzoObjectFeedbackSphere and remnant particles. Fixed stellar mass sum
I'm definitely happy to help with CMake.
The key point is that libtorch installations come with a cmake "config-file". We should be able to use that (rather than creating a |
@WillHicks96 would you mind bringing this branch up-to-date with the main branch of Enzo-E? There are a bunch of conflicts that have to be resolved. Thank you! |
This WIP PR builds off of PR #274, and adds the ability to call pre-trained StarNet models using the C++ frontend of PyTorch (https://pytorch.org/cppdocs/frontend.html) to predict the locations of Pop III stars within an evolving cosmological simulation, as well as the cumulative feedback effects once all stars within a given Pop III association die.
There are a number of changes:
Torch
library at compile time by specifying-DUSE_TORCH=ON
and-DTorch_ROOT=${TORCH_DIR}
CMAKE parameters.EnzoMethodInference
under the comment that reads "ADD DEEP LEARNING INFERENCE HERE". The added code here deserializes pre-trained StarNet checkpoints, accesses the relevant fields for making predictions, rescales the fields, packages them into atorch::Tensor
object, forwards thetorch::Tensor
object to the pre-trained models, interprets the results to identify cells within an inference block that are flagged for star formation, computes population statistics, and finally predicts the size of the conglomerate supernova remnant and metal yields. A tracer particle of typepopIIIremnant
is added onto the mesh at the center of mass of each predicted star-forming region, which contains information about the population statistics, yields, etc. The thought here is that these particles can be analyzed in post to connect Pop III metals with their progenitor stellar populations.EnzoMethodInference
too much to the point that it can't be used for other inference models in the future, I have added theEnzoMethodFBNetDeposit
method to handle the actual deposition Pop III metals and updates to various fields associated with the feedback. Metals are deposited into separate fields based on supernova type (Type II SNe, HNe, or PISNe).EnzoStarNetUtils
andEnzoObjectFeedbackSphere
classes to help out with the calculations and data manipulation mentioned above.StarNet was originally developed and trained in classic Enzo using its inline python capabilities (for more info, see Wells & Norman (2021), Wells & Norman (2022a), and Wells & Norman (2022b)).
PR Checklist
This is a WIP PR is contingent on:
Here's is an image from a 512^3 simulation I ran that shows StarNet in action (publication in progress!):
This is at z=11. Pop III feedback is the only source of metal enrichment in this simulation, so the metal bubbles are all coming from StarNet. The box length is 5 Mpc. The zoomed-in images show density and metallicity slices of the two most massive halos (Mvir = 1e9 Msun roughly).