deeplearing4j with SVHN dataset

300 views Asked by At

I try to model a CNN with deeplearing4j using SVHN dataset (http://ufldl.stanford.edu/housenumbers/), in particular I'm using

Format 2: Cropped Digits

This is matlab's files and each one contains a struct with a tensor (4-D) and an array with label. I would open this one into my deeplearing4j code, so I wondered and I find this class MatlabRecordReader.java into deeplearning4j/DataVec (https://github.com/deeplearning4j/DataVec/blob/master/datavec-api/src/main/java/org/datavec/api/records/reader/impl/misc/MatlabRecordReader.java) but I can't understand how use it. Anybody has experience whit this? Thanks in advance

1

There are 1 answers

3
Adam Gibson On

Here is a reference for "datavec": http://deeplearning4j.org/DataVec So if you look at: http://nd4j.org/tensor

All of deeplearning4j's neural nets are written using nd4j (matlab for java) so this should be pretty easy to map.

You'll see it more or less maps to matlab. What might be easier is if you could just write out the values as a csv and reshape them to be the proper value instead. If you use c ordering it should work fine.

If you do that you can just use the csvrecord reader.

That matlab record reader hasn't been used by a lot of people and I think may only work with matrices (it's been a while)

I would try the csv one first.