From 3f84b62b12276b6e26182e4cc5cf9664553fa86f Mon Sep 17 00:00:00 2001 From: Jorge Fernandez-de-Cossio-Diaz Date: Sat, 5 Aug 2023 12:23:16 +0200 Subject: [PATCH] aqua --- .github/workflows/ci.yml | 10 ++-------- Project.toml | 4 ++-- README.md | 5 ----- example/frozen_weights.jl | 3 +++ test/Project.toml | 2 ++ test/aqua.jl | 12 ++++++++++++ test/runtests.jl | 36 +++++++++++++++++++----------------- test/util.jl | 2 +- 8 files changed, 41 insertions(+), 33 deletions(-) create mode 100644 example/frozen_weights.jl create mode 100644 test/aqua.jl diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b3329cfa..bb3096d8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,8 +12,7 @@ jobs: version: - '1.7' - '1.8' - - '1' - #- 'nightly' + - '1.9' os: - ubuntu-latest - macOS-latest @@ -29,9 +28,4 @@ jobs: - uses: julia-actions/cache@v1 - uses: julia-actions/julia-buildpkg@latest - uses: julia-actions/julia-runtest@latest - - uses: julia-actions/julia-processcoverage@v1 - - uses: codecov/codecov-action@v2 - with: - files: lcov.info - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + diff --git a/Project.toml b/Project.toml index a4196897..227f2fe0 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "RestrictedBoltzmannMachines" uuid = "12e6b396-7db5-4506-8cb6-664a4fe1e50e" authors = ["Jorge Fernandez-de-Cossio-Diaz "] -version = "3.2.0" +version = "3.2.1" [deps] ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" @@ -21,6 +21,6 @@ DiffRules = "1.8" EllipsisNotation = "1" FillArrays = "0.12, 0.13, 1" LogExpFunctions = "0.3" -SpecialFunctions = "2" Optimisers = "0.2" +SpecialFunctions = "2" julia = "1.7" diff --git a/README.md b/README.md index df945817..456d18c3 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,8 @@ # RestrictedBoltzmannMachines Julia package -[![License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/cossio/RestrictedBoltzmannMachines.jl/blob/master/LICENSE.md) [![](https://img.shields.io/badge/docs-stable-blue.svg)](https://cossio.github.io/RestrictedBoltzmannMachines.jl/stable) -[![](https://img.shields.io/badge/docs-dev-blue.svg)](https://cossio.github.io/RestrictedBoltzmannMachines.jl/dev) -![](https://github.com/cossio/RestrictedBoltzmannMachines.jl/workflows/CI/badge.svg) -[![codecov](https://codecov.io/gh/cossio/RestrictedBoltzmannMachines.jl/branch/master/graph/badge.svg?token=O5P8LQTVF3)](https://codecov.io/gh/cossio/RestrictedBoltzmannMachines.jl) Train and sample [Restricted Boltzmann machines](https://en.wikipedia.org/wiki/Restricted_Boltzmann_machine) in Julia. -See the [Documentation](https://cossio.github.io/RestrictedBoltzmannMachines.jl/stable) for details. ## Installation diff --git a/example/frozen_weights.jl b/example/frozen_weights.jl new file mode 100644 index 00000000..ea83aa15 --- /dev/null +++ b/example/frozen_weights.jl @@ -0,0 +1,3 @@ +using RestrictedBoltzmannMachines: RBM, pcd!, Binary + +rbm = RBM(Binary(; θ=zeros(5)), Binary(; θ=zeros(3)), randn(5,3)) diff --git a/test/Project.toml b/test/Project.toml index 8f0bd8e7..57c1da16 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -1,4 +1,5 @@ [deps] +Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab" Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f" EllipsisNotation = "da5c29d0-fa7d-589e-88eb-ea29b0a81949" @@ -19,4 +20,5 @@ ValueHistories = "98cad3c8-aec3-5f06-8e41-884608649ab7" Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f" [compat] +Aqua = "0.6" Distributions = "≥ 0.25" diff --git a/test/aqua.jl b/test/aqua.jl new file mode 100644 index 00000000..3abfb594 --- /dev/null +++ b/test/aqua.jl @@ -0,0 +1,12 @@ +import Aqua +import RestrictedBoltzmannMachines + +using Test: @testset + +@testset "aqua" begin + Aqua.test_all( + RestrictedBoltzmannMachines; + stale_deps=(ignore=[:DiffRules],), + ambiguities=(recursive=false, exclude=[reshape]) + ) +end diff --git a/test/runtests.jl b/test/runtests.jl index 9fc7d3f9..c91ae950 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,22 +1,24 @@ using SafeTestsets: @safetestset -@time @safetestset "util" begin include("util.jl") end -@time @safetestset "linalg" begin include("linalg.jl") end -@time @safetestset "onehot" begin include("onehot.jl") end -@time @safetestset "rbm" begin include("rbm.jl") end -@time @safetestset "layers" begin include("layers.jl") end -@time @safetestset "pseudolikelihood" begin include("pseudolikelihood.jl") end -#@time @safetestset "minibatches" begin include("minibatches.jl") end -@time @safetestset "infinite_minibatches" begin include("infinite_minibatches.jl") end -@time @safetestset "initialization" begin include("initialization.jl") end -@time @safetestset "regularize" begin include("regularize.jl") end -@time @safetestset "truncnorm" begin include("truncnorm.jl") end -@time @safetestset "optim" begin include("optim.jl") end -@time @safetestset "partition" begin include("partition.jl") end -@time @safetestset "metropolis" begin include("metropolis.jl") end +module util_tests include("util.jl") end +module linalg_tests include("linalg.jl") end +module onehot_tests include("onehot.jl") end +module rbm_tests include("rbm.jl") end +module layers_tests include("layers.jl") end +module pseudolikelihood_tests include("pseudolikelihood.jl") end +# module minibatches include("minibatches.jl") end +module infinite_minibatches_tests include("infinite_minibatches.jl") end +module initialization_tests include("initialization.jl") end +module regularize_tests include("regularize.jl") end +module truncnorm_tests include("truncnorm.jl") end +module optim_tests include("optim.jl") end +module partition_tests include("partition.jl") end +module metropolis_tests include("metropolis.jl") end -@time @safetestset "zerosum" begin include("gauge/zerosum.jl") end -@time @safetestset "rescale_hidden" begin include("gauge/rescale_hidden.jl") end -@time @safetestset "pcd" begin include("pcd.jl") end +module zerosum_tests include("gauge/zerosum.jl") end +module rescale_hidden_tests include("gauge/rescale_hidden.jl") end +module pcd_tests include("pcd.jl") end module shift_fields_tests include("shift_fields.jl") end + +module aqua_tests include("aqua.jl") end diff --git a/test/util.jl b/test/util.jl index 86fdcac6..92bb8f98 100644 --- a/test/util.jl +++ b/test/util.jl @@ -1,6 +1,6 @@ import Statistics import RestrictedBoltzmannMachines as RBMs -using Test: @test, @testset, @inferred +using Test: @test, @testset, @inferred, @test_throws using Statistics: mean, var, cov using LinearAlgebra: dot using EllipsisNotation: (..)