JointEnergyModels

A package for Joint Energy Models and Energy-Based Models in Julia.

https://github.com/juliatrustworthyai/jointenergymodels.jl

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.6%) to scientific vocabulary

Keywords

energy-based-deep-learning julia machine-learning
Last synced: 6 months ago · JSON representation ·

Repository

A package for Joint Energy Models and Energy-Based Models in Julia.

Basic Info
Statistics
  • Stars: 2
  • Watchers: 2
  • Forks: 0
  • Open Issues: 8
  • Releases: 6
Topics
energy-based-deep-learning julia machine-learning
Created almost 3 years ago · Last pushed over 1 year ago
Metadata Files
Readme Changelog License Citation

README.md

JointEnergyModels.jl

Joint Energy Models in Julia.

Stable Dev Build Status Coverage Code Style: Blue License Package Downloads Aqua QA

JointEnergyModels.jl is a package for training Joint Energy Models in Julia. Joint Energy Models (JEM) are hybrid models that learn to discriminate between classes $y$ and generate input data $x$. They were introduced in Grathwohl et al. (2020), which provides the foundation for the methodologies implemented in this package.

🔁 Status

This package is still in its infancy and the API is subject to change. Currently, the package can be used to train JEMs for classification. It is also possible to train pure Energy-Based Models (EBMs) for the generative task only. The package is compatible with Flux.jl. Work on compatibility with MLJ.jl (through MLJFlux.jl) is currently under way.

We welcome contributions and feedback at this early stage. To install the development version of the package you can run the following command:

julia using Pkg Pkg.add(url="https://github.com/juliatrustworthyai/JointEnergyModels.jl")

🔍 Usage Example

Below we first generate some synthetic data:

julia nobs=2000 X, y = make_circles(nobs, noise=0.1, factor=0.5) Xplot = Float32.(permutedims(matrix(X))) X = table(permutedims(Xplot)) plt = scatter(Xplot[1,:], Xplot[2,:], group=y, label="") batch_size = Int(round(nobs/10)) display(plt)

The MLJ compatible classifier can be instantiated as follows:

julia 𝒟x = Normal() 𝒟y = Categorical(ones(2) ./ 2) sampler = ConditionalSampler(𝒟x, 𝒟y, input_size=size(Xplot)[1:end-1], batch_size=batch_size) clf = JointEnergyClassifier( sampler; builder=MLJFlux.MLP(hidden=(32, 32, 32,), σ=Flux.relu), batch_size=batch_size, finaliser=x -> x, loss=Flux.Losses.logitcrossentropy, )

It uses the MLJFlux package to build the model:

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

true

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

julia 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.

Owner

  • Name: Taija
  • Login: JuliaTrustworthyAI
  • Kind: organization
  • Location: Netherlands

Home for repositories of the Taija (Trustworthy Artifical Intelligence in Julia) project.

Citation (CITATION.bib)

@misc{JointEnergyModels.jl,
	author  = {Patrick Altmeyer},
	title   = {JointEnergyModels.jl},
	url     = {https://github.com/JuliaTrustworthyAI/JointEnergyModels.jl},
	version = {v0.1.0},
	year    = {2023},
	month   = {3}
}

GitHub Events

Total
  • Push event: 4
  • Create event: 1
Last Year
  • Push event: 4
  • Create event: 1

Committers

Last synced: 7 months ago

All Time
  • Total Commits: 102
  • Total Committers: 2
  • Avg Commits per committer: 51.0
  • Development Distribution Score (DDS): 0.02
Past Year
  • Commits: 11
  • Committers: 1
  • Avg Commits per committer: 11.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
pat-alt a****t@g****m 100
CompatHelper Julia c****y@j****g 2
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 7 months ago

All Time
  • Total issues: 21
  • Total pull requests: 17
  • Average time to close issues: 3 months
  • Average time to close pull requests: 23 days
  • Total issue authors: 3
  • Total pull request authors: 2
  • Average comments per issue: 0.52
  • Average comments per pull request: 0.24
  • Merged pull requests: 14
  • Bot issues: 0
  • Bot pull requests: 3
Past Year
  • Issues: 3
  • Pull requests: 4
  • Average time to close issues: about 1 hour
  • Average time to close pull requests: 36 minutes
  • Issue authors: 1
  • Pull request authors: 1
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.0
  • Merged pull requests: 3
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • pat-alt (13)
  • MarkArdman (2)
  • JuliaTagBot (1)
Pull Request Authors
  • pat-alt (18)
  • github-actions[bot] (3)
Top Labels
Issue Labels
enhancement (7) question (4) bug (3) help wanted (1)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads: unknown
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 8
juliahub.com: JointEnergyModels

A package for Joint Energy Models and Energy-Based Models in Julia.

  • Versions: 8
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 9.9%
Dependent packages count: 38.6%
Average: 44.6%
Forks count: 54.9%
Stargazers count: 75.1%
Last synced: 6 months ago