mratsim / Arraymancer

A fast, ergonomic and portable tensor library in Nim with a deep learning focus for CPU, GPU and embedded devices via OpenMP, Cuda and OpenCL backends
https://mratsim.github.io/Arraymancer/
Apache License 2.0
1.34k stars 96 forks source link

about cifar10-demo #310

Open cashiwamochi opened 6 years ago

cashiwamochi commented 6 years ago

Hello, Thanks for your good DL framework. I implemented simple cifar-10 classification using Arraymancer. The demo is placed here ( https://github.com/cashiwamochi/nim_dl ) . How do you think about adding this to Arraymancer repository. Other DL frameworks have mnist and cifar examples. This suggestion is not weird. By the way, the accuracy of this is not good now. Maybe I need to find good models.

Thanks, R-Y ( cashiwamochi )

mratsim commented 6 years ago

Yes, I will add CIFAR as one of the default downloadable datasets like MNIST.

Regarding accuracy, either there is a bug :P or you need a deeper model like ResNets (or a pretrained NN is needed but for 10 classes I don't think so).

I'll investigate when I allow deep learning model composition which should just need to change this:

https://github.com/mratsim/Arraymancer/blob/0a08949030ceb0ca5499f73e4b6bca280bec774d/src/nn_dsl/dsl_types.nim#L63-L68

into

  TrainableLayer*[TT] = concept layer
    block:
      var trainable: false
      for field in fields(layer):
        trainable = trainable or (field is Variable[TT]) or field is TrainableLayer[TT]
      trainable
cashiwamochi commented 6 years ago

Thanks for your reply. I'll try deeper networks and make something using Arraymancer.

cashiwamochi commented 5 years ago

Hello. Thanks you for the new release. I tried cifar10 classification using v0.4.0, but the performance was worse than expected. ( This is what I reported in this issue. ) Yesterday I tried again using new version, and it worked correctly. The performance is better than the old version and good enough. You can see figures here. https://github.com/cashiwamochi/nim_dl This comment is just a report. Thank you.