Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix paraynaud/KnetNLPModels.jl to JuliaSmoothOptimizers/KnetLNPModels… #20

Merged
merged 3 commits into from
Jun 28, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,4 @@ docs/site/
# environment.
Manifest.toml

test/dvpt/*
retour/*
dvpt/*
6 changes: 3 additions & 3 deletions CITATION.bib
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
@Misc{raynaud2022,
author = {P. Raynaud },
author = {Jean Bigeon, Dominique Orban, P. Raynaud},
title = {{KnetNLPModels.jl}:},
month = {Month},
howpublished = {\url{https://github.com/paraynaud/KnetNLPModels.jl}},
month = {June},
howpublished = {\url{https://github.com/JuliaSmoothOptimizers/KnetNLPModels.jl}},
year = {2022},
DOI = {}
}
26 changes: 15 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@
| [![docs-stable][docs-stable-img]][docs-stable-url] [![docs-dev][docs-dev-img]][docs-dev-url] | [![build-gh][build-gh-img]][build-gh-url] [![build-cirrus][build-cirrus-img]][build-cirrus-url] | [![codecov][codecov-img]][codecov-url] | [![doi][doi-img]][doi-url] |

[docs-stable-img]: https://img.shields.io/badge/docs-stable-blue.svg
[docs-stable-url]: https://paraynaud.github.io/KnetNLPModels.jl/stable
[docs-stable-url]: https://JuliaSmoothOptimizers.github.io/KnetNLPModels.jl/stable
[docs-dev-img]: https://img.shields.io/badge/docs-dev-purple.svg
[docs-dev-url]: https://paraynaud.github.io/KnetNLPModels.jl/dev
[build-gh-img]: https://github.com/paraynaud/KnetNLPModels.jl/workflows/CI/badge.svg?branch=main
[build-gh-url]: https://github.com/paraynaud/KnetNLPModels.jl/actions
[build-cirrus-img]: https://img.shields.io/cirrus/github/paraynaud/KnetNLPModels.jl?logo=Cirrus%20CI
[build-cirrus-url]: https://cirrus-ci.com/github/paraynaud/KnetNLPModels.jl
[codecov-img]: https://codecov.io/gh/paraynaud/KnetNLPModels.jl/branch/main/graph/badge.svg
[codecov-url]: https://app.codecov.io/gh/paraynaud/KnetNLPModels.jl
[docs-dev-url]: https://JuliaSmoothOptimizers.github.io/KnetNLPModels.jl/dev
[build-gh-img]: https://github.com/JuliaSmoothOptimizers/KnetNLPModels.jl/workflows/CI/badge.svg?branch=main
[build-gh-url]: https://github.com/JuliaSmoothOptimizers/KnetNLPModels.jl/actions
[build-cirrus-img]: https://img.shields.io/cirrus/github/JuliaSmoothOptimizers/KnetNLPModels.jl?logo=Cirrus%20CI
[build-cirrus-url]: https://cirrus-ci.com/github/JuliaSmoothOptimizers/KnetNLPModels.jl
[codecov-img]: https://codecov.io/gh/JuliaSmoothOptimizers/KnetNLPModels.jl/branch/main/graph/badge.svg
[codecov-url]: https://app.codecov.io/gh/JuliaSmoothOptimizers/KnetNLPModels.jl
[doi-img]: https://img.shields.io/badge/DOI-10.5281%2Fzenodo.822073-blue.svg
[doi-url]: https://doi.org/10.5281/zenodo.822073
[doi-url]: https://github.com/JuliaSmoothOptimizers/KnetNLPModels.jl/blob/main/CITATION.bib
dpo marked this conversation as resolved.
Show resolved Hide resolved

## How to install
This module can be installed with the following command:
```julia
julia> ] add https://github.com/paraynaud/KnetNLPModels.jl.git
julia> ] add https://github.com/JuliaSmoothOptimizers/KnetNLPModels.jl.git
pkg> test KnetNLPModels
```

Expand Down Expand Up @@ -148,4 +148,8 @@ The size of the new minibatch is the size define earlier.
The size of the training and test minibatch can be set to `1/p` the size of the dataset with:
```julia
set_size_minibatch!(DenseNetNLPModel, p) # p::Int > 1
```
```

## How to Cite

If you use KnetNLPModels.jl in your work, please cite using the format given in [`CITATION.bib`](https://github.com/JuliaSmoothOptimizers/KnetNLPModels.jl/blob/main/CITATION.bib).
2 changes: 1 addition & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ makedocs(
pages = Any["Home" => "index.md", "Tutorial" => "tutorial.md", "Reference" => "reference.md"],
)

deploydocs(repo = "github.com/paraynaud/KnetNLPModels.jl.git", devbranch = "main")
deploydocs(repo = "github.com/JuliaSmoothOptimizers/KnetNLPModels.jl.git", devbranch = "main")
4 changes: 2 additions & 2 deletions src/KnetNLPModels.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ mutable struct KnetNLPModel{T, S, C <: Chain} <: AbstractKnetNLPModel{T, S}
minibatch_test
current_minibatch_training
current_minibatch_testing
w::S # :: Vector{T}
w::S
layers_g::Vector{Param}
nested_cuArray::Vector{CuArray{T, N, CUDA.Mem.DeviceBuffer} where N}
end
Expand All @@ -37,7 +37,7 @@ end
KnetNLPModel(chain_ANN; size_minibatch=100, data_train=MLDatasets.MNIST.traindata(Float32), data_test=MLDatasets.MNIST.testdata(Float32))

Build a `KnetNLPModel` from the neural network represented by `chain_ANN`.
`chain_ANN` is built using [Knet.jl](https://github.com/denizyuret/Knet.jl), see the [tutorial](https://paraynaud.github.io/KnetNLPModels.jl/dev/tutorial/) for more details.
`chain_ANN` is built using [Knet.jl](https://github.com/denizyuret/Knet.jl), see the [tutorial](https://JuliaSmoothOptimizers.github.io/KnetNLPModels.jl/dev/tutorial/) for more details.
The other data required are: an iterator over the training dataset `data_train`, an iterator over the test dataset `data_test` and the size of the minibatch `size_minibatch`.
Suppose `(xtrn,ytrn) = knetnlp.data_train`, then the size of each training minibatch will be `1/size_minibatch * length(ytrn)`.
By default, the other data are respectively set to the training dataset and test dataset of `MLDatasets.MNIST`, with each minibatch a hundredth of the dataset.
Expand Down