Skip to content

Commit

Permalink
Replace epsilon with epsilon / 2 (#83)
Browse files Browse the repository at this point in the history
* Replace epsilon with epsilon / 2

* Patch version

* Fix tutorial
  • Loading branch information
gdalle authored Jul 3, 2023
1 parent b9f4f69 commit 44a3055
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CITATION.bib
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ @misc{InferOpt.jl
author = {Guillaume Dalle, Léo Baty, Louis Bouvier and Axel Parmentier},
title = {InferOpt.jl},
url = {https://github.com/axelparmentier/InferOpt.jl},
version = {v0.5.0},
version = {v0.5.1},
year = {2023},
month = {7}
}
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "InferOpt"
uuid = "4846b161-c94e-4150-8dac-c7ae193c601f"
authors = ["Guillaume Dalle", "Léo Baty", "Louis Bouvier", "Axel Parmentier"]
version = "0.5.0"
version = "0.5.1"

[deps]
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
Expand Down
2 changes: 1 addition & 1 deletion docs/Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ version = "0.4.10"
deps = ["ChainRulesCore", "LinearAlgebra", "Random", "Statistics", "StatsBase", "ThreadsX"]
path = ".."
uuid = "4846b161-c94e-4150-8dac-c7ae193c601f"
version = "0.5.0-DEV"
version = "0.5.1"

[deps.InferOpt.extensions]
InferOptFrankWolfeExt = "DifferentiableFrankWolfe"
Expand Down
2 changes: 1 addition & 1 deletion examples/tutorial.jl
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Here is the crucial part where InferOpt.jl intervenes: the choice of a clever lo
- evaluate the quality of our model based on the paths that it recommends
=#

layer = PerturbedMultiplicative(linear_maximizer; ε=1.0, nb_samples=5);
layer = PerturbedMultiplicative(linear_maximizer; ε=0.1, nb_samples=5);
loss = FenchelYoungLoss(layer);

#=
Expand Down
2 changes: 1 addition & 1 deletion src/imitation/fenchel_young_loss.jl
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ function fenchel_young_F_and_first_part_of_grad(
perturbed::PerturbedMultiplicative, θ::AbstractArray, Z::AbstractArray; kwargs...
)
(; maximizer, ε) = perturbed
eZ = exp.(ε .* Z .- ε^2)
eZ = exp.(ε .* Z .- ε^2 ./ 2)
θ_perturbed = θ .* eZ
y = maximizer(θ_perturbed; kwargs...)
F = dot(θ_perturbed, y)
Expand Down
2 changes: 1 addition & 1 deletion src/perturbed/multiplicative.jl
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function perturb_and_optimize(
perturbed::PerturbedMultiplicative, θ::AbstractArray, Z::AbstractArray; kwargs...
)
(; maximizer, ε) = perturbed
θ_perturbed = θ .* exp.(ε .* Z .- ε^2)
θ_perturbed = θ .* exp.(ε .* Z .- ε^2 ./ 2)
y = maximizer(θ_perturbed; kwargs...)
return y
end
Expand Down

0 comments on commit 44a3055

Please sign in to comment.