From 3de5d872880dee75b125827fd2b6bccd96a2f67d Mon Sep 17 00:00:00 2001 From: dehann Date: Thu, 4 Oct 2018 16:40:57 -0400 Subject: [PATCH 1/3] small fix --- examples/ApproximateConvolution.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/ApproximateConvolution.jl b/examples/ApproximateConvolution.jl index 50c3e2ce6..90f34ff58 100644 --- a/examples/ApproximateConvolution.jl +++ b/examples/ApproximateConvolution.jl @@ -10,7 +10,7 @@ import IncrementalInference: getSample toggleYTicks() -type MultiModalConditional <: IncrementalInference.FunctorPairwise +mutable struct MultiModalConditional <: IncrementalInference.FunctorPairwise x::Vector{Distribution} hypo::Categorical MultiModalConditional{D <: Distribution}(x::Vector{D}, p::Categorical) = new(x, p) From e5f3fdce21cc7091547fd952d59ca27f5ed36dc3 Mon Sep 17 00:00:00 2001 From: dehann Date: Thu, 4 Oct 2018 21:58:37 -0400 Subject: [PATCH 2/3] fixing more bugs and deprecations --- REQUIRE | 1 - src/FactorGraph01.jl | 4 ++-- src/IncrementalInference.jl | 1 - src/SolveTree01.jl | 2 +- 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/REQUIRE b/REQUIRE index 072a5ba5b..f94ed7e98 100644 --- a/REQUIRE +++ b/REQUIRE @@ -6,7 +6,6 @@ Optim 0.16.0 Distributions 0.16.4 StatsBase 0.25.0 KernelDensityEstimate 0.4.0 -HDF5 0.10.2 JLD2 0.1.2 FileIO 1.0.2 ProgressMeter 0.6.0 diff --git a/src/FactorGraph01.jl b/src/FactorGraph01.jl index bf9675435..6109dae44 100644 --- a/src/FactorGraph01.jl +++ b/src/FactorGraph01.jl @@ -151,7 +151,7 @@ function setDefaultNodeData!(v::Graphs.ExVertex, # dims = size(initval,1) # rows indicate dimensions sp = Int[0;] #round.(Int,range(dodims,stop=dodims+dims-1,length=dims)) gbw = getBW(pN)[:,1] - gbw2 = Array{Float64}(length(gbw),1) + gbw2 = Array{Float64}(undef, length(gbw),1) gbw2[:,1] = gbw[:] pNpts = getPoints(pN) data = VariableNodeData(initval, stdev, pNpts, @@ -299,7 +299,7 @@ function getVal(vA::Array{Graphs.ExVertex,1}) cols = cumsum(cols) sc = cols[end] rw = floor(Int,rows[1]) - val = Array{Float64,2}(rw, sc) + val = Array{Float64,2}(undef,rw, sc) for i in 1:(len-1) val[:,(cols[i]+1):cols[i+1]] = vals[i] end diff --git a/src/IncrementalInference.jl b/src/IncrementalInference.jl index a38701cd7..0738402eb 100644 --- a/src/IncrementalInference.jl +++ b/src/IncrementalInference.jl @@ -16,7 +16,6 @@ using Random, NLsolve, StatsBase, - HDF5, JLD2, FileIO, ProgressMeter, diff --git a/src/SolveTree01.jl b/src/SolveTree01.jl index 001f28b94..b643f8bc2 100644 --- a/src/SolveTree01.jl +++ b/src/SolveTree01.jl @@ -263,7 +263,7 @@ function productbelief(fg::FactorGraph, pGM = getPoints(dens[1]) else @warn "Unknown density product on vertid=$(vertid), lennonp=$(lennonp), lenpart=$(lenpart)" - pGM = Array{Float64,2}(0,1) + pGM = Array{Float64,2}(undef, 0,1) end return pGM From fa70f22e2a6d57026b5a949ec34e418f9381b2fd Mon Sep 17 00:00:00 2001 From: dehann Date: Thu, 4 Oct 2018 22:18:27 -0400 Subject: [PATCH 3/3] wip on HDF and travis error --- src/IncrementalInference.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/IncrementalInference.jl b/src/IncrementalInference.jl index 0738402eb..2a551e0fe 100644 --- a/src/IncrementalInference.jl +++ b/src/IncrementalInference.jl @@ -26,7 +26,7 @@ using const KDE = KernelDensityEstimate import Base: convert -import HDF5: root +# import HDF5: root import Distributions: sample import Random: rand, rand! import KernelDensityEstimate: kde!