Skip to content

Commit

Permalink
feat(training_configuration):tensor_names_t object
Browse files Browse the repository at this point in the history
  • Loading branch information
rouson committed Oct 27, 2024
1 parent bb119af commit b969f81
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
15 changes: 9 additions & 6 deletions demo/app/train-cloud-microphysics.F90
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ program train_cloud_microphysics
call system_clock(t_finish)

print *,"System clock time: ", real(t_finish - t_start, real64)/real(clock_rate, real64)
print *,new_line('a') // "______train_cloud_microhpysics done _______"
print *,new_line('a') // "______train_cloud_microphysics done _______"

contains

Expand Down Expand Up @@ -164,11 +164,14 @@ subroutine read_train_write(training_configuration, args, plot_file)
integer(int64) start_training, finish_training
logical stop_requested

type(file_t) file

file = file_t(training_configuration%to_json())
call file%write_lines()

input_names: &
associate(input_names => &
[string_t("pressure"), string_t("potential_temperature"), string_t("temperature"), &
string_t("qv"), string_t("qc"), string_t("qr"), string_t("qs")] &
)
associate(input_names => training_configuration%input_names())

allocate(input_variable(size(input_names)))

input_file_name: &
Expand Down Expand Up @@ -196,7 +199,7 @@ subroutine read_train_write(training_configuration, args, plot_file)
end associate input_names

output_names: &
associate(output_names => [string_t("potential_temperature"),string_t("qv"), string_t("qc"), string_t("qr"), string_t("qs")])
associate(output_names => training_configuration%output_names())

allocate(output_variable(size(output_names)))

Expand Down
5 changes: 5 additions & 0 deletions demo/training_configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,10 @@
"skip connections" : false,
"nodes per layer" : [7,32,32,32,5],
"activation function" : "sigmoid"
},
,
"tensor names": {
"inputs" : ["pressure", "potential_temperature", "temperature", "qv", "qc", "qr", "qs"],
"outputs" : ["potential_temperature","qv", "qc", "qr", "qs"]
}
}

0 comments on commit b969f81

Please sign in to comment.