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

Generalize train cloud microphysics #220

Merged
merged 25 commits into from
Oct 29, 2024
Merged

Conversation

rouson
Copy link
Contributor

@rouson rouson commented Oct 28, 2024

This PR adds a tensor_names_t object to the demo/training_configuration.json file and adjusts the train-cloud-microphysics demonstration application to read the object and use it to determine what training-data input and output variables to read from the NetCDF files produced by the neural-network branch of the Berkeley Lab fork of ICAR. With NetCDF files demo/training_input.f90 and demo/training_output.f90, a sample training run should produce output similar to the following:

cd demo
% ./build/run-fpm.sh run train-cloud-microphysics --flag -O3 -- --base training --epochs 10 --start 720 --bins 4
Project is up to date
 Reading physics-based model inputs from training_input.nc
 - reading potential_temperature
 - reading qv
 - reading qc
 - reading qr
 - reading qs
 - reading pressure
 - reading temperature
 - reading time
 Reading physics-based model outputs from training_output.nc
 - reading potential_temperature
 - reading qv
 - reading qc
 - reading qr
 - reading qs
 - reading time
 Calculating desired neural-network model outputs
 - dpotential_temperature/dt
 - dqv/dt
 - dqc/dt
 - dqr/dt
 - dqs/dt
 Defining input tensors for time step 720 through 720 with strides of 1
 Defining output tensors for time step 720 through 720 with strides of 1
 Defining a new network from training_configuration_t and tensor_map_t objects
 Conditionally sampling for a flat distribution of output values
 Keeping 39 out of 1250565 input/output pairs in 39 out of 1024 bins.
 Normalizing the remaining input and output tensors
 Training network
        Epoch  Cost (avg)
1    .14993742
2    .80107644E-1
3    .7153832E-1
4    .70149295E-1
5    .7109204E-1
6    .7106401E-1
7    .7154923E-1
8    .7048027E-1
9    .69384895E-1
10    .7029437E-1
 Training time:  2.6504E-02 for 10 epochs
 System clock time:  384.031288

rouson added 25 commits October 15, 2024 20:06
This dependency version update supports JSON file I/O capabilities
used in the new tensor_map_t derived type.
This improves the formatting of test-reporting output.
This improves the output in any uses of Julienne's file_t
write_lines type-bound procedure.
This commit matches the outputs list to the beginning of the inputs
list to ensure correct time derivative calculations.
This commit adds parentheses to the time differencing formula to
correclty account for operator precedence.
This commit replaces an `open` statement with an `inquire`
statatement to prevent a crash when mistakenly attempting
to reopen an already open file.
@rouson rouson marked this pull request as ready for review October 29, 2024 04:19
@rouson rouson merged commit 18b6e6e into main Oct 29, 2024
4 checks passed
@rouson rouson deleted the generalize-train-cloud-microphysics branch October 29, 2024 04:24
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.

1 participant