![]() 1221: DataLoader with NamedTuple r=CarloLucibello a=cossio Just a couple of small changes, so that `DataLoader` can be created with a `NamedTuple` of tensors instead of `Tuple`. This way the tensors can be referred to by name. For example ``` train_loader = DataLoader((images = Xtrain, labels = Ytrain), batchsize=16) batch = first(train_loader) y = model(batch.images) logitcrossentropy(y, batch.labels) ``` If we only use tuples, then in datasets with multiple tensors one has to be careful about the order in which the tensors are fed into the `DataLoader` constructor and be consistent with this elsewhere. With `NamedTuples` one just have to be consistent about the names used, which I think is a minor improvement. CC @CarloLucibello ### PR Checklist - [x] Tests are added - [x] Entry in NEWS.md - [x] Documentation, if applicable I don't think this qualifies as an API change. It's just a minor feature addition. So final review probably not required. - [ ] Final review from `@MikeInnes` or `@dhairyagandhi96` (for API changes). Co-authored-by: cossio <j.cossio.diaz@gmail.com> Co-authored-by: cossio <cossio@users.noreply.github.com> |
||
---|---|---|
.github | ||
docs | ||
paper | ||
src | ||
test | ||
.gitattributes | ||
.gitignore | ||
.gitlab-ci.yml | ||
.travis.yml | ||
CITATION.bib | ||
LICENSE.md | ||
Manifest.toml | ||
NEWS.md | ||
Project.toml | ||
README.md | ||
bors.toml |
README.md
Flux is an elegant approach to machine learning. It's a 100% pure-Julia stack, and provides lightweight abstractions on top of Julia's native GPU and AD support. Flux makes the easy things easy while remaining fully hackable.
] add Flux
See the documentation or the model zoo for examples.
If you use Flux in your research, please cite our work.