JointEnergyModels
A package for Joint Energy Models and Energy-Based Models in Julia.
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
Repository
A package for Joint Energy Models and Energy-Based Models in Julia.
Basic Info
- Host: GitHub
- Owner: JuliaTrustworthyAI
- License: mit
- Language: TeX
- Default Branch: main
- Homepage: https://www.taija.org/JointEnergyModels.jl/
- Size: 11.9 MB
Statistics
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 8
- Releases: 6
Topics
Metadata Files
README.md
JointEnergyModels.jl
Joint Energy Models in Julia.
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
- Repositories: 2
- Profile: https://github.com/JuliaTrustworthyAI
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
Top Committers
| Name | 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
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.
- Homepage: https://www.taija.org/JointEnergyModels.jl/
- Documentation: https://docs.juliahub.com/General/JointEnergyModels/stable/
- License: MIT
-
Latest release: 0.1.7
published over 1 year ago