Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix formatting issues #54

Merged
merged 4 commits into from
May 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ext/DensityRatioEstimationChainRulesCoreExt.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# ------------------------------------------------------------------
# Licensed under the MIT License. See LICENSE in the project root.
# ------------------------------------------------------------------

module DensityRatioEstimationChainRulesCoreExt

if isdefined(Base, :get_extension)
Expand Down
1 change: 1 addition & 0 deletions ext/DensityRatioEstimationConvexExt.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# ------------------------------------------------------------------
# Licensed under the MIT License. See LICENSE in the project root.
# ------------------------------------------------------------------

module DensityRatioEstimationConvexExt

if isdefined(Base, :get_extension)
Expand Down
1 change: 1 addition & 0 deletions ext/DensityRatioEstimationGPUArraysExt.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# ------------------------------------------------------------------
# Licensed under the MIT License. See LICENSE in the project root.
# ------------------------------------------------------------------

module DensityRatioEstimationGPUArraysExt

if isdefined(Base, :get_extension)
Expand Down
1 change: 1 addition & 0 deletions ext/DensityRatioEstimationJuMPExt.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# ------------------------------------------------------------------
# Licensed under the MIT License. See LICENSE in the project root.
# ------------------------------------------------------------------

module DensityRatioEstimationJuMPExt

if isdefined(Base, :get_extension)
Expand Down
3 changes: 3 additions & 0 deletions ext/DensityRatioEstimationOptimExt.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# ------------------------------------------------------------------
# Licensed under the MIT License. See LICENSE in the project root.
# ------------------------------------------------------------------

module DensityRatioEstimationOptimExt

if isdefined(Base, :get_extension)
Expand All @@ -12,7 +13,9 @@ else
using ..DensityRatioEstimation: KLIEP, LSIF, OptimLib
using ..Optim
end

using LinearAlgebra

include("../src/kliep/optim.jl")
include("../src/lsif/optim.jl")

Expand Down
13 changes: 5 additions & 8 deletions src/DensityRatioEstimation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,27 +32,25 @@ include("lcv.jl")
# pure Julia implementations
include("kmm/julia.jl")

# implementations that require extra dependencies
if !isdefined(Base, :get_extension)
using Requires
end
# implementations that require extra dependencies
@static if !isdefined(Base, :get_extension)
function __init__()

#Solvers

#JuMP: KMM, LSIF
# JuMP: KMM, LSIF
@require JuMP = "4076af6c-e467-56ae-b986-b466b2749572" begin
@require Ipopt = "b6b21f68-93f8-5de0-b562-5493be1d77c9" begin
include("../ext/DensityRatioEstimationJuMPExt.jl")
end
end
#Optim: KLIEP, LSIF

# Optim: KLIEP, LSIF
@require Optim = "429524aa-4258-5aef-a3af-852621145aeb" begin
include("../ext/DensityRatioEstimationOptimExt.jl")
end

#Convex: KLIEP
# Convex: KLIEP
@require Convex = "f65535da-76fb-5f13-bab9-19810c17039a" begin
@require ECOS = "e2685f51-7e38-5353-a97d-a921fd2c8199" begin
include("../ext/DensityRatioEstimationConvexExt.jl")
Expand All @@ -63,7 +61,6 @@ end
@require ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" begin
include("../ext/DensityRatioEstimationChainRulesCoreExt.jl")
end

@require GPUArrays = "0c68f7d7-f131-5f86-a1c3-88cf8149b2d7" begin
include("../ext/DensityRatioEstimationGPUArraysExt.jl")
end
Expand Down
2 changes: 1 addition & 1 deletion src/kliep/convex.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Licensed under the MIT License. See LICENSE in the project root.
# ------------------------------------------------------------------

#This file is part of the module DensityRatioEstimationConvexExt.
# This file is part of the module DensityRatioEstimationConvexExt.

function DensityRatioEstimation._kliep_coeffs(K_nu, K_de, dre::KLIEP, optlib::Type{ConvexLib})
# retrieve parameters
Expand Down
2 changes: 1 addition & 1 deletion src/kliep/optim.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Licensed under the MIT License. See LICENSE in the project root.
# ------------------------------------------------------------------

#This file is part of the module DensityRatioEstimationOptimExt.
# This file is part of the module DensityRatioEstimationOptimExt.

function DensityRatioEstimation._kliep_coeffs(K_nu, K_de, dre::KLIEP, optlib::Type{OptimLib})
# retrieve parameters
Expand Down
2 changes: 1 addition & 1 deletion src/kmm/jump.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Licensed under the MIT License. See LICENSE in the project root.
# ------------------------------------------------------------------

#This file is part of the module DensityRatioEstimationJuMPExt.
# This file is part of the module DensityRatioEstimationJuMPExt.

function _kmm_jump_model(K, κ, dre::AbstractKMM, optlib::Type{JuMPLib})
# number of denominator samples
Expand Down
2 changes: 1 addition & 1 deletion src/lsif/jump.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Licensed under the MIT License. See LICENSE in the project root.
# ------------------------------------------------------------------

#This file is part of the module DensityRatioEstimationJuMPExt.
# This file is part of the module DensityRatioEstimationJuMPExt.

function DensityRatioEstimation._lsif_coeffs(H, h, dre::LSIF, optlib::Type{JuMPLib})
# retrieve parameters
Expand Down
2 changes: 1 addition & 1 deletion src/lsif/optim.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Licensed under the MIT License. See LICENSE in the project root.
# ------------------------------------------------------------------

#This file is part of the module DensityRatioEstimationOptimExt.
# This file is part of the module DensityRatioEstimationOptimExt.

function DensityRatioEstimation._lsif_coeffs(H, h, dre::LSIF, optlib::Type{OptimLib})
# retrieve parameters
Expand Down