Comments (6)
swap the SoftMax for SquaredLoss, ie: ```
net->addLayer( SquareLossMaker::instance() );
from deepcl.
Ah, you mean, the NetLearner doesnt accept floats? Hmmm, let me check...
from deepcl.
Yeah, I got as far as the SquareLossMaker as described in the API docs, and I've got all my floats packed into what's described as the data format on the same page. There's just no way to pass a float array to NetLearner.
from deepcl.
Hmmm, seems you are right: all the batch helper classes only accept labels. But ... I remember I created a class to generalize labels vs expected data, which is ... file BatchData.hhttps://github.com/hughperkins/DeepCL/blob/master/src/batch/BatchData.h which has a base class
OutputData, and two child classes:
ExpectedData(ie what you want), and
LabelledData. So, anywhere that accepts an
OutputData *in theory implicitly accepted
ExpectedData *. Then.... searching through the files in
batchdirectory, there are a few classes that accept
OutputData *`:
- some classes in NetAction2 https://github.com/hughperkins/DeepCL/blob/master/src/batch/NetAction2.h , and
- Batcher2 class https://github.com/hughperkins/DeepCL/blob/master/src/batch/Batcher2.h
Looking at Batcher2, it takes in:
- a NetLearner object, which decides are we doing forward prop only (NetForwardAction2), or training, forward/backward prop (NetLearnAction2) (both are in https://github.com/hughperkins/DeepCL/blob/master/src/batch/NetAction2.h )
- an
OutputData *
, to which we pass ourExpectedData *
object - an
InputData *
object, for hte input data - the
Net *
that we want to train
... and then you just need to call tick()
on this a bunch of times, I think, check getEpochDone()
after each tick, and call reset()
after each epoch
There is also LearnBatcher2 child class, which provides the NetLearnAction2
for you https://github.com/hughperkins/DeepCL/blob/master/src/batch/Batcher2.h#L67
So, that will handle running batches on all your data. If your data fits in memory, I think that's all you need.
Unfortunately, if you need to handle loading a bit of data at a time, since the data wont fit in memory, it looks like you'll need to handle that yourself, calling out to eg LearnBatcher2 for each set of batches. There are wrappers such as https://github.com/hughperkins/DeepCL/blob/master/src/batch/NetLearnerOnDemandv2.h , but it looks like they dont use the LearnBatcher2 etc, and all assume labelled data, for now.
from deepcl.
My data should fit in memory, so I'll check out LearnBatcher2...
If I can make it work I'll try and update the docs.
from deepcl.
Ok, cool. Let me know how that goes please
from deepcl.
Related Issues (20)
- clBlas error HOT 5
- MNIST data format HOT 1
- Python Q-Learning - Add Dropout Layout causes runtime error HOT 11
- can passed all test in #ad1ab61, but not now (#b256220) HOT 48
- function "NetLearner::learn" is deprecated, how to train a network by the new method? HOT 2
- How to use ExpectedData correctly in training? HOT 2
- tutorial and documentation is very less
- integrated demo HOT 2
- could deepcl run on FPGAs? HOT 1
- deepcl_predict HOT 5
- does the Neural network created on GPU? HOT 3
- captcha
- pip with windows does not work
- Need cythonize
- deepcl_unittests not running in CentOS 7. HOT 2
- opencl 1.1?
- Feature Request: Add Mish activation HOT 3
- How to set stride of conv layer? HOT 2
- Implementation of DNN on FPGA HOT 2
- Any examples for face detection?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deepcl.