Giter VIP home page Giter VIP logo

Comments (7)

chrishkchris avatar chrishkchris commented on July 23, 2024

@XJDKC In this case, I suggest we can use the buffer operation feature so there won't be any actual run.
Then, in case if we don't want to use graph after getting the parameter size, we can use ResetGraph to clear the buffer, then turn off buffer and run without graph.

from singa.

XJDKC avatar XJDKC commented on July 23, 2024

I worry that if we move the param creation and initialization into the forward propagation stage, those initialization operations will also be buffered and included in the graph.

from singa.

chrishkchris avatar chrishkchris commented on July 23, 2024

I worry that if we move the param creation and initialization into the forward propagation stage, those initialization operations will also be buffered and included in the graph.

@XJDKC Can use ResetGraph to reset the buffer?

from singa.

XJDKC avatar XJDKC commented on July 23, 2024

I worry that if we move the param creation and initialization into the forward propagation stage, those initialization operations will also be buffered and included in the graph.

@XJDKC Can use ResetGraph to reset the buffer?

I prefer adding an initialization function for Layer, the module just needs to call the init function of each layer to initialize the whole model.

from singa.

chrishkchris avatar chrishkchris commented on July 23, 2024

I worry that if we move the param creation and initialization into the forward propagation stage, those initialization operations will also be buffered and included in the graph.

@XJDKC Can use ResetGraph to reset the buffer?

I prefer adding an initialization function for Layer, the module just needs to call the init function of each layer to initialize the whole model.

@XJDKC
Yes, in the following example the parameter of the layer is initialized in the call function, where its shape is infered from the input size of that layer

self.W = Tensor(shape=(self.handle.weights_size,),

Can this case be handled?

from singa.

XJDKC avatar XJDKC commented on July 23, 2024

I worry that if we move the param creation and initialization into the forward propagation stage, those initialization operations will also be buffered and included in the graph.

@XJDKC Can use ResetGraph to reset the buffer?

I prefer adding an initialization function for Layer, the module just needs to call the init function of each layer to initialize the whole model.

@XJDKC
Yes, in the following example the parameter of the layer is initialized in the call function, where its shape is infered from the input size of that layer

self.W = Tensor(shape=(self.handle.weights_size,),

Can this case be handled?

The handle can be created in the init function, and then W can be initialized by the handle.

from singa.

nudles avatar nudles commented on July 23, 2024

#696

from singa.

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.