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

done? #29

Merged
merged 4 commits into from
Sep 9, 2024
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
1 change: 0 additions & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ jobs:
fail-fast: false
matrix:
version:
- '1.6'
- '1.10'
os:
- ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@

/.quarto/

Manifest.toml
**/Manifest.toml
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),

*Note*: We try to adhere to these practices as of version [v0.1.4].

## Version [0.1.6] - 2024-09-09

### Changed

- Now depending on new `EnergySamplers` package for energy-based sampling. [#27]

## Version [0.1.5] - 2024-06-07

### Changed
Expand Down
14 changes: 9 additions & 5 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
name = "JointEnergyModels"
uuid = "48c56d24-211d-4463-bbc0-7a701b291131"
authors = ["Patrick Altmeyer"]
version = "0.1.5"
version = "0.1.6"

[deps]
CategoricalArrays = "324d7699-5711-5eae-9e2f-1d82baa6b597"
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
ComputationalResources = "ed09eef8-17a6-5b46-8889-db040fac31e3"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
EnergySamplers = "f446124b-5d5e-4171-a6dd-a1d99768d3ce"
Flux = "587475ba-b771-5e3f-ad9e-33799f191a9c"
MLJFlux = "094fc8d1-fd35-5302-93ea-dabda2abf845"
MLJModelInterface = "e80e1ace-859a-464e-9ed9-23947d8ae3ea"
MLUtils = "f1d291b0-491e-4a28-83b9-f70985020b54"
Optimisers = "3bd65402-5787-11e9-1adc-39752487f4e2"
ProgressMeter = "92933f4c-e287-5a05-a399-4b506db050ca"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
Expand All @@ -26,19 +28,21 @@ CategoricalArrays = "0.10"
ChainRulesCore = "1.16"
ComputationalResources = "0.3"
Distributions = "0.25"
EnergySamplers = "1.0.0"
Flux = "0.13, 0.14"
MLJFlux = "0.2, 0.3, 0.4.0"
MLJFlux = "0.2, 0.3, 0.4, 0.5"
MLJModelInterface = "1.8"
MLUtils = "0.4"
Optimisers = "0.3"
ProgressMeter = "1.7"
Random = "1.6, 1.10"
Random = "1.10"
Reexport = "1.2.2"
StatsBase = "0.33, 0.34"
Tables = "1.10"
TaijaBase = "1.1.0"
Test = "1.6, 1.10"
Test = "1.10"
Zygote = "0.6"
julia = "1.6, 1.10"
julia = "1.10"

[extras]
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
Expand Down
4 changes: 2 additions & 2 deletions src/JointEnergyModels.jl
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
module JointEnergyModels

using EnergySamplers
using Flux
using TaijaBase
using TaijaBase.Samplers

using Reexport
@reexport import TaijaBase.Samplers: ConditionalSampler, UnconditionalSampler, JointSampler
@reexport import EnergySamplers: ConditionalSampler, UnconditionalSampler, JointSampler

include("utils.jl")
export _energy
Expand Down
3 changes: 2 additions & 1 deletion src/mlj_flux.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ using ComputationalResources
using Flux
using MLJFlux
import MLJModelInterface as MMI
using Optimisers
using ProgressMeter
using Random
using Tables
Expand Down Expand Up @@ -31,7 +32,7 @@ function JointEnergyClassifier(
sampler::AbstractSampler;
builder::B = default_builder_jem,
finaliser::F = Flux.softmax,
optimiser::O = Flux.Optimise.Adam(),
optimiser::O = Optimisers.Adam(),
loss::L = Flux.crossentropy,
epochs::Int = 100,
batch_size::Int = 100,
Expand Down
2 changes: 1 addition & 1 deletion src/model.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using ChainRulesCore
using Flux
using Flux.Losses: logitcrossentropy
using TaijaBase.Samplers: ImproperSGLD
using EnergySamplers: ImproperSGLD

struct JointEnergyModel
chain::Chain
Expand Down
2 changes: 1 addition & 1 deletion src/samplers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ using Distributions

Outer constructor for `ConditionalSampler`.
"""
function TaijaBase.Samplers.ConditionalSampler(
function EnergySamplers.ConditionalSampler(
X::Union{Tables.MatrixTable,AbstractMatrix},
y::Union{CategoricalArray,AbstractMatrix};
batch_size::Int = 1,
Expand Down
Loading
Loading