Skip to content

Commit

Permalink
Set better defaults for unit normal case
Browse files Browse the repository at this point in the history
  • Loading branch information
juliohm committed Jun 16, 2020
1 parent 733d986 commit ca74733
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions src/kliep.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ Kullback-Leibler importance estimation procedure (KLIEP).
## Parameters
* `σ` - Bandwidth of Gaussian kernel (default to `1.0`)
* `b` - Maximum number of radial basis functions (default to `20`)
* `σ` - Bandwidth of Gaussian kernel (default to `2.0`)
* `b` - Maximum number of radial basis functions (default to `10`)
## References
Expand All @@ -22,8 +22,8 @@ Kullback-Leibler importance estimation procedure (KLIEP).
* Júlio Hoffimann ([email protected])
"""
@with_kw struct KLIEP{T} <: DensityRatioEstimator
σ::T=1.0
b::Int=20
σ::T=2.0
b::Int=10
end

default_optlib(dre::Type{<:KLIEP}) = OptimLib
Expand Down
6 changes: 3 additions & 3 deletions src/kmm.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Kernel Mean Matching (KMM).
## Parameters
* `σ` - Bandwidth of Gaussian kernel (default to `1.0`)
* `σ` - Bandwidth of Gaussian kernel (default to `2.0`)
* `B` - Maximum discrepancy allowed (default to `Inf`)
* `ϵ` - Tolerance for unit sum (default to `0.01`)
* `λ` - Regularization parameter (default to `0.001`)
Expand All @@ -25,7 +25,7 @@ Kernel Mean Matching (KMM).
* Kai Xu ([email protected])
"""
@with_kw struct KMM{T} <: DensityRatioEstimator
σ::T=1.0
σ::T=2.0
B::T=Inf
ϵ::T=0.01
λ::T=0.001
Expand All @@ -51,7 +51,7 @@ function _kmm_consts(x_nu, x_de, dre::KMM{T}) where {T<:AbstractFloat}
Kdede, T(n_de / n_nu) * sum(Kdenu, dims=2)
end

function _densratio(x_nu, x_de, dre::KMM,
function _densratio(x_nu, x_de, dre::KMM,
optlib::Type{<:OptimizationLibrary})
K, κ = _kmm_consts(x_nu, x_de, dre)
_kmm_ratios(K, κ, dre, optlib)
Expand Down
8 changes: 4 additions & 4 deletions src/lsif.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ Least squares importance fitting.
## Parameters
* `σ` - Bandwidth of Gaussian kernel (default to `1.0`)
* `b` - Maximum number of radial basis functions (default to `20`)
* `σ` - Bandwidth of Gaussian kernel (default to `2.0`)
* `b` - Maximum number of radial basis functions (default to `10`)
* `λ` - Regularization parameter (default to `0.001`)
## References
Expand All @@ -23,8 +23,8 @@ Importance Estimation
* Júlio Hoffimann ([email protected])
"""
@with_kw struct LSIF{T} <: DensityRatioEstimator
σ::T=1.0
b::Int=20
σ::T=2.0
b::Int=10
λ::T=0.001
end

Expand Down

0 comments on commit ca74733

Please sign in to comment.