From f997829ede740c2dadebea30b88197d59e148020 Mon Sep 17 00:00:00 2001 From: "Documenter.jl" Date: Fri, 7 Jun 2024 14:11:33 +0000 Subject: [PATCH] build based on 38fd7d7 --- dev/.documenter-siteinfo.json | 2 +- dev/assets/resources-commonmark/index.html | 2 +- dev/assets/resources/index.html | 2 +- dev/explanation/index.html | 2 +- dev/explanation/samplers/index.html | 2 +- dev/how_to_guides/index.html | 2 +- dev/how_to_guides/mlj_flux/index.html | 2 +- dev/index.html | 2 +- dev/reference/index.html | 4 ++-- dev/tutorials/index.html | 2 +- dev/tutorials/mnist/index.html | 2 +- dev/tutorials/synthetic/index.html | 2 +- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/dev/.documenter-siteinfo.json b/dev/.documenter-siteinfo.json index 3f78db3..73f66fd 100644 --- a/dev/.documenter-siteinfo.json +++ b/dev/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.10.4","generation_timestamp":"2024-06-07T10:45:46","documenter_version":"1.4.1"}} \ No newline at end of file +{"documenter":{"julia_version":"1.10.4","generation_timestamp":"2024-06-07T14:11:28","documenter_version":"1.4.1"}} \ No newline at end of file diff --git a/dev/assets/resources-commonmark/index.html b/dev/assets/resources-commonmark/index.html index ff0aa28..7af434a 100644 --- a/dev/assets/resources-commonmark/index.html +++ b/dev/assets/resources-commonmark/index.html @@ -1,2 +1,2 @@ -Further Resources · JointEnergyModels.jl
+Further Resources · JointEnergyModels.jl
diff --git a/dev/assets/resources/index.html b/dev/assets/resources/index.html index fd32455..af66516 100644 --- a/dev/assets/resources/index.html +++ b/dev/assets/resources/index.html @@ -1,2 +1,2 @@ -Further Resources · JointEnergyModels.jl
+Further Resources · JointEnergyModels.jl
diff --git a/dev/explanation/index.html b/dev/explanation/index.html index 5dd9186..e9b351d 100644 --- a/dev/explanation/index.html +++ b/dev/explanation/index.html @@ -1,2 +1,2 @@ -- · JointEnergyModels.jl
+- · JointEnergyModels.jl
diff --git a/dev/explanation/samplers/index.html b/dev/explanation/samplers/index.html index a0bae6b..e0d5b0e 100644 --- a/dev/explanation/samplers/index.html +++ b/dev/explanation/samplers/index.html @@ -64,4 +64,4 @@ plt = plot(plts_i..., size=(_w,0.10*_w), layout=(1,10)) plts = [plts..., plt] end -plot(plts..., size=(_w,_w), layout=(10,1)) +plot(plts..., size=(_w,_w), layout=(10,1)) diff --git a/dev/how_to_guides/index.html b/dev/how_to_guides/index.html index 9387c1b..96ccbca 100644 --- a/dev/how_to_guides/index.html +++ b/dev/how_to_guides/index.html @@ -1,2 +1,2 @@ -- · JointEnergyModels.jl
+- · JointEnergyModels.jl
diff --git a/dev/how_to_guides/mlj_flux/index.html b/dev/how_to_guides/mlj_flux/index.html index 5f78682..aa2a038 100644 --- a/dev/how_to_guides/mlj_flux/index.html +++ b/dev/how_to_guides/mlj_flux/index.html @@ -90,4 +90,4 @@ plt = plot(plts_i..., size=(_w,0.10*_w), layout=(1,10)) plts = [plts..., plt] end -plot(plts..., size=(_w,_w), layout=(10,1)) +plot(plts..., size=(_w,_w), layout=(10,1)) diff --git a/dev/index.html b/dev/index.html index 1f5e2a3..f4e4397 100644 --- a/dev/index.html +++ b/dev/index.html @@ -16,4 +16,4 @@ finaliser=x -> x, loss=Flux.Losses.logitcrossentropy, )

It uses the MLJFlux package to build the model:

println(typeof(clf) <: MLJFlux.MLJFluxModel)
true

The model can be wrapped in data and trained using the fit! function:

mach = machine(clf, X, y)
-fit!(mach)

The results are visualised below. The model has learned to discriminate between the two classes (as indicated by the contours) and to generate samples from each class (as indicated by the stars).

🎓 References

Grathwohl, Will, Kuan-Chieh Wang, Joern-Henrik Jacobsen, David Duvenaud, Mohammad Norouzi, and Kevin Swersky. 2020. “Your Classifier Is Secretly an Energy Based Model and You Should Treat It Like One.” In. https://openreview.net/forum?id=Hkxzx0NtDB.

+fit!(mach)

The results are visualised below. The model has learned to discriminate between the two classes (as indicated by the contours) and to generate samples from each class (as indicated by the stars).

🎓 References

Grathwohl, Will, Kuan-Chieh Wang, Joern-Henrik Jacobsen, David Duvenaud, Mohammad Norouzi, and Kevin Swersky. 2020. “Your Classifier Is Secretly an Energy Based Model and You Should Treat It Like One.” In. https://openreview.net/forum?id=Hkxzx0NtDB.

diff --git a/dev/reference/index.html b/dev/reference/index.html index 39edf8d..3a1070f 100644 --- a/dev/reference/index.html +++ b/dev/reference/index.html @@ -1,6 +1,6 @@ -Reference · JointEnergyModels.jl

Reference

In this reference, you will find a detailed overview of the package API.

Reference guides are technical descriptions of the machinery and how to operate it. Reference material is information-oriented.

Diátaxis

In other words, you come here because you want to take a very close look at the code 🧐.

Content

Exported functions

TaijaBase.Samplers.ConditionalSamplerMethod
ConditionalSampler(
+Reference · JointEnergyModels.jl

Reference

In this reference, you will find a detailed overview of the package API.

Reference guides are technical descriptions of the machinery and how to operate it. Reference material is information-oriented.

Diátaxis

In other words, you come here because you want to take a very close look at the code 🧐.

Content

Exported functions

TaijaBase.Samplers.ConditionalSamplerMethod
ConditionalSampler(
     X::AbstractArray, y::AbstractArray;
     batch_size::Int,
     max_len::Int=10000, prob_buffer::AbstractFloat=0.95
-)

Outer constructor for ConditionalSampler.

source
JointEnergyModels._energyMethod
energy(f, x, y::Int; agg=mean)

Computes the energy for conditional samples $x \sim p_{\theta}(x|y)$: $E(x)=- f_{\theta}(x)[y]$.

source
JointEnergyModels._energyMethod
energy(f, x)

Computes the energy for unconditional samples $x \sim p_{\theta}(x)$: $E(x)=-\text{LogSumExp}_y f_{\theta}(x)[y]$.

source
JointEnergyModels.generate_conditional_samplesMethod
generate_conditional_samples(model, rule::Flux.Optimise.AbstractOptimiser, n::Int, y::Int; kwargs...)

A convenience function for generating conditional samples for a given model, sampler and sampling rule. If n is missing, then the sampler's batch_size is used. The conditioning value y needs to be specified.

source
JointEnergyModels.generate_samplesMethod
generate_samples(jem::JointEnergyModel, n::Int; kwargs...)

A convenience function for generating samples for a given energy model. If n is missing, then the sampler's batch_size is used.

source

Internal functions

+)

Outer constructor for ConditionalSampler.

source
JointEnergyModels._energyMethod
energy(f, x, y::Int; agg=mean)

Computes the energy for conditional samples $x \sim p_{\theta}(x|y)$: $E(x)=- f_{\theta}(x)[y]$.

source
JointEnergyModels._energyMethod
energy(f, x)

Computes the energy for unconditional samples $x \sim p_{\theta}(x)$: $E(x)=-\text{LogSumExp}_y f_{\theta}(x)[y]$.

source
JointEnergyModels.generate_conditional_samplesMethod
generate_conditional_samples(model, rule::Flux.Optimise.AbstractOptimiser, n::Int, y::Int; kwargs...)

A convenience function for generating conditional samples for a given model, sampler and sampling rule. If n is missing, then the sampler's batch_size is used. The conditioning value y needs to be specified.

source
JointEnergyModels.generate_samplesMethod
generate_samples(jem::JointEnergyModel, n::Int; kwargs...)

A convenience function for generating samples for a given energy model. If n is missing, then the sampler's batch_size is used.

source

Internal functions

diff --git a/dev/tutorials/index.html b/dev/tutorials/index.html index a7dbff2..2a19fd6 100644 --- a/dev/tutorials/index.html +++ b/dev/tutorials/index.html @@ -1,2 +1,2 @@ -- · JointEnergyModels.jl
+- · JointEnergyModels.jl
diff --git a/dev/tutorials/mnist/index.html b/dev/tutorials/mnist/index.html index 96f3e54..92e0e0c 100644 --- a/dev/tutorials/mnist/index.html +++ b/dev/tutorials/mnist/index.html @@ -79,4 +79,4 @@ plt = plot(plts_i..., size=(_w,0.10*_w), layout=(1,10)) plts = [plts..., plt] end -plot(plts..., size=(_w,_w), layout=(10,1)) +plot(plts..., size=(_w,_w), layout=(10,1)) diff --git a/dev/tutorials/synthetic/index.html b/dev/tutorials/synthetic/index.html index b877d88..27b7fe8 100644 --- a/dev/tutorials/synthetic/index.html +++ b/dev/tutorials/synthetic/index.html @@ -88,4 +88,4 @@ push!(plts, plt) end plot(plts..., layout=(1, size(y,1)), size=(size(y,1)*400, 400)) -end +end