Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,9 @@ Read the paper [here](https://arxiv.org/abs/1902.06714).
| Embedding | `embedding` | n/a | 2 | ✅ | ✅ |
| Dense (fully-connected) | `dense` | `input1d`, `dense`, `dropout`, `flatten` | 1 | ✅ | ✅ |
| Dropout | `dropout` | `dense`, `flatten`, `input1d` | 1 | ✅ | ✅ |
| Locally connected (1-d) | `locally_connected1d` | `input2d`, `locally_connected1d`, `conv1d`, `maxpool1d`, `reshape2d` | 2 | ✅ | ✅ |
| Convolutional (1-d) | `conv1d` | `input2d`, `conv1d`, `maxpool1d`, `reshape2d` | 2 | ✅ | ✅ |
| Convolutional (2-d) | `conv2d` | `input3d`, `conv2d`, `maxpool2d`, `reshape` | 3 | ✅ | ✅ |
| Max-pooling (1-d) | `maxpool1d` | `input2d`, `conv1d`, `maxpool1d`, `reshape2d` | 2 | ✅ | ✅ |
| Max-pooling (2-d) | `maxpool2d` | `input3d`, `conv2d`, `maxpool2d`, `reshape` | 3 | ✅ | ✅ |
| Locally connected (1-d) | `locally_connected` | `input`, `locally_connected`, `conv`, `maxpool`, `reshape` | 2 | ✅ | ✅ |
| Convolutional (1-d and 2-d) | `conv` | `input`, `conv`, `maxpool`, `reshape` | 2, 3 | ✅ | ✅ |
| Max-pooling (1-d and 2-d) | `maxpool` | `input`, `conv`, `maxpool`, `reshape` | 2, 3 | ✅ | ✅ |
| Linear (2-d) | `linear2d` | `input2d`, `layernorm`, `linear2d`, `self_attention` | 2 | ✅ | ✅ |
| Self-attention | `self_attention` | `input2d`, `layernorm`, `linear2d`, `self_attention` | 2 | ✅ | ✅ |
| Layer Normalization | `layernorm` | `linear2d`, `self_attention` | 2 | ✅ | ✅ |
Expand Down
10 changes: 5 additions & 5 deletions example/cnn_mnist.f90
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
program cnn_mnist

use nf, only: network, sgd, &
input, conv2d, maxpool2d, flatten, dense, reshape, &
input, conv, maxpool, flatten, dense, reshape, &
load_mnist, label_digits, softmax, relu

implicit none
Expand All @@ -21,10 +21,10 @@ program cnn_mnist
net = network([ &
input(784), &
reshape(1, 28, 28), &
conv2d(filters=8, kernel_size=3, activation=relu()), &
maxpool2d(pool_size=2), &
conv2d(filters=16, kernel_size=3, activation=relu()), &
maxpool2d(pool_size=2), &
conv(filters=8, kernel_width=3, kernel_height=3, activation=relu()), &
maxpool(pool_width=2, pool_height=2, stride=2), &
conv(filters=16, kernel_width=3, kernel_height=3, activation=relu()), &
maxpool(pool_width=2, pool_height=2, stride=2), &
dense(10, activation=softmax()) &
])

Expand Down
10 changes: 5 additions & 5 deletions example/cnn_mnist_1d.f90
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
program cnn_mnist_1d

use nf, only: network, sgd, &
input, conv1d, maxpool1d, flatten, dense, reshape, locally_connected1d, &
input, maxpool, flatten, dense, reshape, locally_connected, &
load_mnist, label_digits, softmax, relu

implicit none
Expand All @@ -21,10 +21,10 @@ program cnn_mnist_1d
net = network([ &
input(784), &
reshape(28, 28), &
locally_connected1d(filters=8, kernel_size=3, activation=relu()), &
maxpool1d(pool_size=2), &
locally_connected1d(filters=16, kernel_size=3, activation=relu()), &
maxpool1d(pool_size=2), &
locally_connected(filters=8, kernel_size=3, activation=relu()), &
maxpool(pool_width=2, stride=2), &
locally_connected(filters=16, kernel_size=3, activation=relu()), &
maxpool(pool_width=2, stride=2), &
dense(10, activation=softmax()) &
])

Expand Down
2 changes: 1 addition & 1 deletion fpm.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name = "neural-fortran"
version = "0.21.0"
version = "0.22.0"
license = "MIT"
author = "Milan Curcic"
maintainer = "[email protected]"
Expand Down
8 changes: 3 additions & 5 deletions src/nf.f90
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,16 @@ module nf
use nf_datasets_mnist, only: label_digits, load_mnist
use nf_layer, only: layer
use nf_layer_constructors, only: &
conv1d, &
conv2d, &
conv, &
dense, &
dropout, &
embedding, &
flatten, &
input, &
layernorm, &
linear2d, &
locally_connected1d, &
maxpool1d, &
maxpool2d, &
locally_connected, &
maxpool, &
reshape, &
self_attention
use nf_loss, only: mse, quadratic
Expand Down
Loading