-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set better defaults for unit normal case
- Loading branch information
Showing
3 changed files
with
11 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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`) | ||
|
@@ -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 | ||
|
@@ -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) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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 | ||
|
||
|