Skip to content

Commit

Permalink
cleanup and update regularized
Browse files Browse the repository at this point in the history
  • Loading branch information
BatyLeo committed Dec 23, 2024
1 parent a17c51f commit 4068071
Show file tree
Hide file tree
Showing 13 changed files with 95 additions and 799 deletions.
16 changes: 3 additions & 13 deletions src/InferOpt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@ using ChainRulesCore: ChainRulesCore, NoTangent, RuleConfig, Tangent, ZeroTangen
using ChainRulesCore: rrule, rrule_via_ad, unthunk
using DensityInterface: logdensityof
using DifferentiableExpectations:
DifferentiableExpectations,
Reinforce,
empirical_predistribution,
empirical_distribution,
FixKwargs
DifferentiableExpectations, Reinforce, empirical_predistribution, empirical_distribution
using Distributions:
Distributions,
ContinuousUnivariateDistribution,
Expand All @@ -34,9 +30,9 @@ using RequiredInterfaces

include("interface.jl")

include("utils/utils.jl")
include("utils/some_functions.jl")
include("utils/pushforward.jl")
include("utils/generalized_maximizer.jl")
include("utils/linear_maximizer.jl")
include("utils/isotonic_regression/isotonic_l2.jl")
include("utils/isotonic_regression/isotonic_kl.jl")
Expand All @@ -48,8 +44,6 @@ include("layers/simple/identity.jl")

include("layers/perturbed/utils.jl")
include("layers/perturbed/perturbation.jl")
# include("layers/perturbed/additive.jl")
# include("layers/perturbed/multiplicative.jl")
include("layers/perturbed/perturbed.jl")

include("layers/regularized/abstract_regularized.jl")
Expand All @@ -72,18 +66,14 @@ include("losses/imitation_loss.jl")
export half_square_norm
export shannon_entropy, negative_shannon_entropy
export one_hot_argmax, ranking
export GeneralizedMaximizer
export LinearMaximizer, apply_g, apply_h, objective_value

# export FixedAtomsProbabilityDistribution
# export compute_expectation
# export compute_probability_distribution
export Pushforward

export IdentityRelaxation
export Interpolation

export AbstractRegularized, AbstractRegularizedGeneralizedMaximizer
export AbstractRegularized
export SoftArgmax, soft_argmax
export SparseArgmax, sparse_argmax
export SoftRank, soft_rank, soft_rank_l2, soft_rank_kl
Expand Down
2 changes: 2 additions & 0 deletions src/interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ Supertype for all the optimization layers defined in InferOpt.
"""
abstract type AbstractOptimizationLayer <: AbstractLayer end

get_maximizer(layer::AbstractOptimizationLayer) = nothing

## Losses

"""
Expand Down
153 changes: 0 additions & 153 deletions src/layers/perturbed/_abstract_perturbed.jl

This file was deleted.

128 changes: 0 additions & 128 deletions src/layers/perturbed/_additive.jl

This file was deleted.

Loading

0 comments on commit 4068071

Please sign in to comment.