Skip to content

Commit 513c22c

Browse files
committed
revise readme
1 parent 5d862d5 commit 513c22c

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

README.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,20 @@
22

33
## Usage
44

5+
We currently support MNIST, FashionMNIST, and CIFAR10 training datasets.
6+
7+
Download or fetch datasets locally like:
8+
59
```elixir
610
{train_images, train_labels} = AxonDatasets.MNIST.download()
711

12+
# Unpack train_images like...
813
{images_binary, tensor_type, shape} = train_images
14+
```
915

10-
# Transform the data as it's fetched
16+
You can also pass transform functions to `download/1`:
17+
18+
```elixir
1119
transform_images = fn {binary, type, shape} ->
1220
binary
1321
|> Nx.from_binary(type)
@@ -20,7 +28,7 @@ end
2028
AxonDatasets.MNIST.download(transform_images: transform_images)
2129

2230
# Transform labels as well, e.g. get one-hot encoding
23-
transform_labels = fn {labels_binary, type, _shape} ->
31+
transform_labels = fn {labels_binary, type, _} ->
2432
labels_binary
2533
|> Nx.from_binary(type)
2634
|> Nx.new_axis(-1)
@@ -45,7 +53,3 @@ def deps do
4553
]
4654
end
4755
```
48-
49-
Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)
50-
and published on [HexDocs](https://hexdocs.pm). Once published, the docs can
51-
be found at [https://hexdocs.pm/axon_data](https://hexdocs.pm/axon_data).

0 commit comments

Comments
 (0)