jaak-s / BayesianDataFusion.jl

Bayesian multi-tensor factorization methods, with side information
Other
29 stars 19 forks source link

Error trying out example on subtying of NormalWishart #9

Open spinkney opened 6 years ago

spinkney commented 6 years ago

When testing the example script I get an error on the "subtyping in definition of NormalWishart". Error reproduced below. Related to this issue.

Julia Version 0.6.2
Commit d386e40c17* (2017-12-13 18:08 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.9.1 (ORCJIT, skylake)
using BayesianDataFusion
using MAT

## load and setup data
pkgdir = Pkg.dir("BayesianDataFusion")
data   = matread("$pkgdir/data/movielens_1m.mat")

INFO: Precompiling module BayesianDataFusion.
ERROR: LoadError: LoadError: invalid subtyping in definition of NormalWishart
Stacktrace:
 [1] include_from_node1(::String) at .\loading.jl:576
 [2] include(::String) at .\sysimg.jl:14
 [3] include_from_node1(::String) at .\loading.jl:576
 [4] include(::String) at .\sysimg.jl:14
 [5] anonymous at .\<missing>:2
while loading C:\Users\.julia\v0.6\BayesianDataFusion\src\normal_wishart.jl, in expression starting on line 7
while loading C:\Users\.julia\v0.6\BayesianDataFusion\src\BayesianDataFusion.jl, in expression starting on line 5

Failed to precompile BayesianDataFusion to C:\Users\.julia\lib\v0.6\BayesianDataFusion.ji.

Stacktrace:
 [1] compilecache(::String) at .\loading.jl:710
 [2] _require(::Symbol) at .\loading.jl:497
 [3] require(::Symbol) at .\loading.jl:405
 [4] include_string(::String, ::String) at .\loading.jl:522

Possible fix is something like

struct NormalWishart{I<:Int, B<:Bool, Num<:Real, ST<:AbstractPDMat}  <: ContinuousMatrixDistribution
    dim::I
    zeromean::B
    mu::Vector{Num}
    kappa::Num
    #Tchol::Cholesky{Num}  # Precision matrix (well, sqrt of one)
    T::ST
    nu::Num
end
jaak-s commented 6 years ago

Thanks for the report.

The fix seems to break v0.5 however. Would you have a fix that still works for v0.5?