Giter Site home page Giter Site logo

Comments (6)

hughperkins avatar hughperkins commented on June 1, 2024

swap the SoftMax for SquaredLoss, ie: ```
net->addLayer( SquareLossMaker::instance() );

from deepcl.

hughperkins avatar hughperkins commented on June 1, 2024

Ah, you mean, the NetLearner doesnt accept floats? Hmmm, let me check...

from deepcl.

gh2k avatar gh2k commented on June 1, 2024

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.

hughperkins avatar hughperkins commented on June 1, 2024

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 classOutputData, and two child classes:ExpectedData(ie what you want), andLabelledData. So, anywhere that accepts anOutputData *in theory implicitly acceptedExpectedData *. Then.... searching through the files inbatchdirectory, there are a few classes that acceptOutputData *`:

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 our ExpectedData * 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.

gh2k avatar gh2k commented on June 1, 2024

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.

hughperkins avatar hughperkins commented on June 1, 2024

Ok, cool. Let me know how that goes please

from deepcl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.