Skip to content

Commit c5b49fe

Browse files
committed
Clean up example and add a note to emphasize the user API; Co-authored-by: Damian Rouson <rouson@lbl.gov>
1 parent c05368a commit c5b49fe

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,9 @@ examples, in increasing level of complexity:
176176
2. [sine](example/sine.f90): Approximating a sine function
177177
3. [mnist](example/mnist.f90): Hand-written digit recognition using the MNIST dataset
178178

179+
The examples also show you the extent of the public API that's meant to be
180+
used in applications, i.e. anything from the `nf` module.
181+
179182
The MNIST example uses [curl](https://curl.se/) to download the dataset,
180183
so make sure you have it installed on your system.
181184
Most Linux OSs have it out of the box.

example/mnist.f90

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
program mnist
2-
use nf, only: dense, input, network
3-
use nf_datasets_mnist, only: label_digits, load_mnist
4-
use nf_optimizers, only: sgd
2+
3+
use nf, only: dense, input, network, sgd, label_digits, load_mnist
54

65
implicit none
76

src/nf.f90

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
module nf
2+
!! User API: everything an application needs to reference directly
23
use nf_datasets_mnist, only: label_digits, load_mnist
34
use nf_layer, only: layer
45
use nf_layer_constructors, only: conv2d, dense, input, maxpool2d
56
use nf_network, only: network
7+
use nf_optimizers, only: sgd
68
end module nf

0 commit comments

Comments
 (0)