Skip to content

Commit

Permalink
chore(examples): match program names to file names
Browse files Browse the repository at this point in the history
and fix the usage message correspondingly
  • Loading branch information
rouson committed Jan 6, 2024
1 parent c2d3017 commit bf9d020
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 152 deletions.
6 changes: 3 additions & 3 deletions example/concurrent-inferences.f90
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
! Copyright (c), The Regents of the University of California
! Terms of use are as specified in LICENSE.txt
program concurrent_inference
program concurrent_inferences
!! This program demonstrates how to read a neural network from a JSON file
!! and use the network to perform concurrent inferences.
use inference_engine_m, only : inference_engine_t, tensor_t
Expand All @@ -16,12 +16,12 @@ program concurrent_inference

if (len(network_file_name%string())==0) then
error stop new_line('a') // new_line('a') // &
'Usage: ./build/run-fpm.sh run --example identity -- --network "<file-name>"'
'Usage: ./build/run-fpm.sh run --example concurrent-inferences -- --network "<file-name>"'
end if

block
type(inference_engine_t) network, inference_engine
type(tensor_t), allocatable :: inputs(:,:,:), outputs(:,:,:)
type(tensor_t), allocatable :: inputs(:,:,:), outputs(:,:,:)
real, allocatable :: input_components(:,:,:,:)
integer, parameter :: lat=263, lon=317, lev=15 ! latitudes, longitudes, levels (elevations)
integer i, j, k
Expand Down
137 changes: 0 additions & 137 deletions example/fit-polynomials.f90

This file was deleted.

6 changes: 3 additions & 3 deletions example/learn-addition.f90
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
! Copyright (c), The Regents of the University of California
! Terms of use are as specified in LICENSE.txt
module add_inputs
module addition_m
!! Define a function that produces the desired network output for a given network input
use inference_engine_m, only : tensor_t
use assert_m, only : assert
Expand All @@ -18,7 +18,7 @@ elemental function y(x_tensor) result(a_tensor)

end module

program train_polynomials
program learn_addition
!! This trains a neural network to learn the following six polynomial functions of its eight inputs.
use inference_engine_m, only : &
inference_engine_t, trainable_engine_t, mini_batch_t, tensor_t, input_output_pair_t, shuffle, relu_t
Expand All @@ -34,7 +34,7 @@ program train_polynomials

if (len(final_network_file%string())==0) then
error stop new_line('a') // new_line('a') // &
'Usage: ./build/run-fpm.sh run --example train-polynomials -- --output-file "<file-name>"'
'Usage: ./build/run-fpm.sh run --example learn-addition -- --output-file "<file-name>"'
end if

block
Expand Down
6 changes: 3 additions & 3 deletions example/learn-exponentiation.f90
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
! Copyright (c), The Regents of the University of California
! Terms of use are as specified in LICENSE.txt
module raise_inputs_to_a_power
module exponentiation_m
!! Define a function that produces the desired network output for a given network input
use inference_engine_m, only : tensor_t
use assert_m, only : assert
Expand All @@ -18,13 +18,13 @@ elemental function y(x_tensor) result(a_tensor)

end module

program train_polynomials
program learn_exponentiation
!! This trains a neural network to learn the following six polynomial functions of its eight inputs.
use inference_engine_m, only : &
inference_engine_t, trainable_engine_t, mini_batch_t, tensor_t, input_output_pair_t, shuffle, relu_t
use sourcery_m, only : string_t, file_t, command_line_t, bin_t, csv
use assert_m, only : assert, intrinsic_array_t
use raise_inputs_to_a_power, only : y
use exponentiation_m, only : y
implicit none

type(string_t) intial_network_file, final_network_file
Expand Down
2 changes: 1 addition & 1 deletion example/learn-microphysics-procedures.f90
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ program learn_microphysics_procedures

if (len(network_file%string())==0) then
error stop new_line('a') // new_line('a') // &
'Usage: ./build/run-fpm.sh run learn_microphysics_procedures -- --output-file "<file-name>"'
'Usage: ./build/run-fpm.sh run learn-microphysics-procedures -- --output-file "<file-name>"'
end if

call system_clock(counter_start, clock_rate)
Expand Down
4 changes: 2 additions & 2 deletions example/learn-multiplication.f90
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ elemental function y(x_tensor) result(a_tensor)

end module

program train_polynomials
program learn_multiplication
!! This trains a neural network to learn the following six polynomial functions of its eight inputs.
use inference_engine_m, only : &
inference_engine_t, trainable_engine_t, mini_batch_t, tensor_t, input_output_pair_t, shuffle, relu_t
Expand All @@ -34,7 +34,7 @@ program train_polynomials

if (len(final_network_file%string())==0) then
error stop new_line('a') // new_line('a') // &
'Usage: ./build/run-fpm.sh run --example train-polynomials -- --output-file "<file-name>"'
'Usage: ./build/run-fpm.sh run --example learn-multiplication -- --output-file "<file-name>"'
end if

block
Expand Down
4 changes: 2 additions & 2 deletions example/learn-power-series.f90
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ elemental function y(x_in) result(a)

end module

program train_polynomials
program learn_power_series
!! This trains a neural network to learn the following six polynomial functions of its eight inputs.
use inference_engine_m, only : &
inference_engine_t, trainable_engine_t, mini_batch_t, tensor_t, input_output_pair_t, shuffle, relu_t
Expand All @@ -34,7 +34,7 @@ program train_polynomials

if (len(final_network_file%string())==0) then
error stop new_line('a') // new_line('a') // &
'Usage: ./build/run-fpm.sh run --example train-polynomials -- --output-file "<file-name>"'
'Usage: ./build/run-fpm.sh run --example learn-power-series -- --output-file "<file-name>"'
end if

block
Expand Down
2 changes: 1 addition & 1 deletion example/write-read-infer.f90
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ program write_read_infer

if (len(file_name%string())==0) then
error stop new_line('a') // new_line('a') // &
'Usage: ./build/run-fpm.sh run --example identity -- --output-file "<file-name>"'
'Usage: ./build/run-fpm.sh run --example write-read-infer -- --output-file "<file-name>"'
end if

call write_read_query_infer(file_name)
Expand Down

0 comments on commit bf9d020

Please sign in to comment.