BIDData / BIDMat

A CPU and GPU-accelerated matrix library for data mining
BSD 3-Clause "New" or "Revised" License
265 stars 73 forks source link

*^ index out of bounds #56

Closed jamesjia94 closed 8 years ago

jamesjia94 commented 8 years ago

scala> val a = rand(3,4) a: BIDMat.FMat = 0.40857 0.65735 0.18252 0.21719 0.82198 0.38203 0.57885 0.25747 0.13365 0.036090 0.57698 0.28741

scala> val b = rand(3,4) b: BIDMat.FMat = 0.44102 0.63252 0.38195 0.052384 0.99267 0.053118 0.0094332 0.070619 0.34677 0.82116 0.74243 0.42345

scala> a *^ b java.lang.ArrayIndexOutOfBoundsException: 9 at BIDMat.FMat.fDMultTHelper(FMat.scala:752) at BIDMat.FMat.multT(FMat.scala:778) at BIDMat.FMat.$times$up(FMat.scala:1253) ... 33 elided

DanielTakeshi commented 8 years ago

Hmm ... what version are you using? I copied and pasted your commands and they seem fine to me. I'm using BIDMach and BIDMat as of today.

scala> val a = rand(3,4)
a: BIDMat.FMat =
   0.62465   0.26990   0.39953   0.59721
   0.63891  0.050579   0.91040   0.80420
   0.84862   0.73763   0.49750   0.55897

scala> val b = rand(3,4)
b: BIDMat.FMat =
   0.52764   0.51923   0.21865   0.20012
  0.059120  0.086997   0.41737   0.23329
   0.95167   0.58714   0.10430   0.67991

scala> a *^ b
res2: BIDMat.FMat =
  0.67660  0.36648   1.2007
  0.72338  0.60976   1.2795
   1.0514  0.45238   1.6726

Note: you can put in code in Github comments using the "```" wrap.

fmg-kevin-kilroy commented 8 years ago

I'm seeing this error also, using BIDMach 1.0.3 on OSX

import BIDMat.{CMat, CSMat, DMat, Dict, FMat, FND, GMat, GDMat, GIMat, GLMat, GSMat, GSDMat, HMat, IDict, Image, IMat, LMat, Mat, SMat, SBMat, SDMat}
import BIDMat.MatFunctions._
import BIDMat.SciFunctions._
import BIDMat.Solvers._
import BIDMat.Plotting._
import BIDMach.Learner
import BIDMach.models.{FM, GLM, KMeans, KMeansw, LDA, LDAgibbs, Model, NMF, SFA, RandomForest}
import BIDMach.networks.DNN
import BIDMach.datasources.{DataSource, MatDS, FilesDS, SFilesDS}
import BIDMach.mixins.{CosineSim, Perplexity, Top, L1Regularizer, L2Regularizer}
import BIDMach.updaters.{ADAGrad, Batch, BatchNorm, IncMult, IncNorm, Telescoping}
import BIDMach.causal.IPTW
Cant find native CPU libraries
Cant find native HDF5 library
Couldnt load CUDA runtime

Welcome to Scala version 2.11.2 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_77).
Type in expressions to have them evaluated.
Type :help for more information.

scala> val a = rand(3,4)
a: BIDMat.FMat =
   0.35220   0.65258  0.036466   0.99557
   0.60489   0.86963   0.97922   0.78230
   0.94532  0.058336   0.25055   0.32130

scala> val b = rand(3,4)
b: BIDMat.FMat =
  0.64503  0.13270  0.90378  0.11487
  0.82805  0.30121  0.28766  0.99566
  0.80126  0.16047  0.98435  0.80532

scala> a *^ b
java.lang.ArrayIndexOutOfBoundsException: 9
  at BIDMat.FMat.fDMultTHelper(FMat.scala:694)
  at BIDMat.FMat.multT(FMat.scala:720)
  at BIDMat.FMat.$times$up(FMat.scala:1044)
  ... 33 elided

scala>