Skip to content

Commit

Permalink
Merge 76a8f6c into d0ba69a
Browse files Browse the repository at this point in the history
  • Loading branch information
englhardt committed Nov 5, 2018
2 parents d0ba69a + 76a8f6c commit 78ac892
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 9 deletions.
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ julia:

matrix:
fast_finish: true
allow_failures:
- julia: 1.0

notifications:
email: false
Expand Down
2 changes: 1 addition & 1 deletion src/classifiers/classifier.jl
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ end
is_K_adjusted(model)::Bool = model.adjust_K

function update_K!(model)
updated_K = MLKernels.kernelmatrix(MLKernels.ColumnMajor(), model.kernel_fct, model.data)
updated_K = MLKernels.kernelmatrix(Val(:col), model.kernel_fct, model.data)
if !isdefined(model, :K) || updated_K != model.K || (!isdefined(model, :K_adjusted) && model.adjust_K)
debug(LOGGER, "[UPDATE_K] Updating Kernel matrix.")
invalidate_solution!(model)
Expand Down
2 changes: 1 addition & 1 deletion src/init_strategies/strategies_C.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function calculate_C(model, strategy::BinarySearchCStrategy, kernel)
debug(LOGGER, "[BINARY_SEARCH] Search parameters: C_min = $(C_min), C_max = $(C_max), max_iter = $(strategy.max_iter).")

m = deepcopy(model)
init_strategy = SVDD.FixedParameterInitialization(GaussianKernel(kernel), C_current)
init_strategy = SVDD.FixedParameterInitialization(kernel, C_current)
SVDD.initialize!(m, init_strategy)

while true
Expand Down
2 changes: 1 addition & 1 deletion src/init_strategies/strategies_combined.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ end

function get_parameters(model, strategy::GammaFirstCombinedStrategy)
gamma = calculate_gamma(model, strategy.gamma_strategy)
C = calculate_C(model, strategy.C_strategy, gamma)
C = calculate_C(model, strategy.C_strategy, MLKernels.GaussianKernel(gamma))
return (C, MLKernels.GaussianKernel(gamma))
end
4 changes: 2 additions & 2 deletions src/init_strategies/strategies_gamma.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
abstract type InitializationStrategyGamma <: InitializationStrategy end

struct FixedGammaStrategy <: InitializationStrategyGamma
kernel::Kernel
kernel::SquaredExponentialKernel
end

calculate_gamma(model, strategy::FixedGammaStrategy) = strategy.kernel
calculate_gamma(model, strategy::FixedGammaStrategy) = MLKernels.getvalue(strategy.kernel.alpha)

"""
Original publication:
Expand Down
4 changes: 2 additions & 2 deletions test/classifiers/classifier_svdd_neg_test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
SVDD.fit!(svdd_neg, TEST_SOLVER)
predictions = SVDD.predict(svdd_neg, dummy_data)
@test sum(predictions .> 0) == 0
pools[labels .== "outlier"] = :Lout
pools[labels .== "outlier"] .= :Lout

SVDD.set_pools!(svdd_neg, pools)
@test_throws SVDD.ModelStateException SVDD.predict(svdd_neg, dummy_data)
Expand All @@ -71,7 +71,7 @@
expected = SVDD.predict(svdd_neg, dummy_data)
@test sum(expected .> 0) > 0

pools[labels .== "inlier"] = :Lin
pools[labels .== "inlier"] .= :Lin
SVDD.set_pools!(svdd_neg, pools)

SVDD.fit!(svdd_neg, TEST_SOLVER)
Expand Down

0 comments on commit 78ac892

Please sign in to comment.