Skip to content

Commit ce6a127

Browse files
committed
Corrected verbose for tests
1 parent b6b94e4 commit ce6a127

File tree

6 files changed

+14
-8
lines changed

6 files changed

+14
-8
lines changed

Project.toml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ uuid = "b1c2f168-d918-11e8-38ee-334f3e5b0caa"
33
authors = ["Theo Galy-Fajou <theo.galyfajou@gmail.com>"]
44
version = "0.3.1"
55

6-
[compat]
7-
julia = "0.7"
8-
96
[deps]
107
Clustering = "aaaa29a8-35af-508c-8bc3-b662a17a0fe5"
118
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
@@ -22,8 +19,12 @@ Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
2219
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
2320
ValueHistories = "98cad3c8-aec3-5f06-8e41-884608649ab7"
2421

22+
[compat]
23+
julia = "1.0"
24+
2525
[extras]
26-
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
2726
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
27+
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
28+
2829
[targets]
29-
test = ["Test","Pkg"]
30+
test = ["Test", "Pkg"]

src/models/StudentT_Functions.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Functions related to the Student T likelihood (StudentT)
22
"Update the local variational parameters of the full batch GP StudentT"
33
function local_update!(model::BatchStudentT)
4-
model.β = 0.5.*(diag(model.Σ)+(model.μ.-model.y).^2+model.ν)
4+
model.β = 0.5.*(diag(model.Σ)+(model.μ.-model.y).^2 .+model.ν)
55
model.θ = 0.5.*(model.ν.+1.0)./model.β
66
end
77

@@ -14,7 +14,7 @@ end
1414

1515
"Update the local variational parameters of the sparse GP StudentT"
1616
function local_update!(model::SparseStudentT)
17-
model.β = 0.5.*(model.Ktilde+sum((model.κ*model.Σ).*model.κ,dims=2)[:]+(model.κ*model.μ.-model.y[model.MBIndices]).^2.+model.ν)
17+
model.β = 0.5.*(model.Ktilde+sum((model.κ*model.Σ).*model.κ,dims=2)[:]+(model.κ*model.μ.-model.y[model.MBIndices]).^2 .+model.ν)
1818
model.θ = 0.5.*(model.ν.+1.0)./model.β
1919

2020
end

test/test_IO.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,15 @@ kernel = RBFKernel([3.0],dim=N_dim)
2525
fullm = true
2626
sparsem = true
2727
ps = []; t_full = 0; t_sparse = 0; t_stoch = 0;
28+
println("Testing the save/load model function")
2829
if fullm
2930
println("Testing the full model")
3031
t_full = @elapsed fullmodel = AugmentedGaussianProcesses.BatchXGPC(X,y,noise=noise,kernel=kernel,verbose=verbose,Autotuning=true)
3132
t_full += @elapsed fullmodel.train(iterations=20)
3233
y_full = fullmodel.predictproba(X_test); acc_full = 1-sum(abs.(sign.(y_full.-0.5)-y_test))/(2*length(y_test))
3334
save_trained_model("fullXGPC_test.jld2",fullmodel)
3435
fmodel = load_trained_model("fullXGPC_test.jld2")
36+
rm("fullXGPC_test.jld2")
3537
y_full2 = fmodel.predictproba(X_test)
3638
if mean(abs.(y_full-y_full2))>1e-5
3739
return false
@@ -46,6 +48,7 @@ if sparsem
4648
y_sparse = sparsemodel.predictproba(X_test); acc_sparse = 1-sum(abs.(sign.(y_sparse.-0.5)-y_test))/(2*length(y_test))
4749
save_trained_model("sparseXGPC_test.jld2",sparsemodel)
4850
smodel = load_trained_model("sparseXGPC_test.jld2")
51+
rm("sparseXGPC_test.jld2")
4952
y_sparse2 = smodel.predictproba(X_test)
5053
if mean(abs.(y_sparse-y_sparse2))>1e-5
5154
return false

test/test_Regression.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ ps = []; t_full = 0; t_sparse = 0; t_stoch = 0;
3131

3232
kernel = RBFKernel(2.0)
3333
autotuning=false
34+
println("Testing the regression model")
3435

3536
println("Testing the full model")
3637
t_full = @elapsed fullmodel = AugmentedGaussianProcesses.GPRegression(X,y,noise=noise,Autotuning=autotuning,kernel=kernel,verbose=verbose)

test/test_StudentT.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ ps = []; t_full = 0; t_sparse = 0; t_stoch = 0;
3737
fullm = true
3838
sparsem =true
3939
stochm = true
40+
println("Testing the StudentT model")
4041

4142
if fullm
4243
println("Testing the full model")

test/test_XGPC.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ if doPlots
1313
using Plots
1414
pyplot()
1515
end
16-
println("Testing the XGPC")
16+
println("Testing the XGPC model")
1717
### TESTING WITH TOY XOR DATASET
1818
N_data = 1000;N_test = 20
1919
N_indpoints = 20; N_dim = 2

0 commit comments

Comments
 (0)