Coder Social home page Coder Social logo

Finding value of weights about neurodiffeq HOT 2 CLOSED

Arup-nit avatar Arup-nit commented on July 3, 2024
Finding value of weights

from neurodiffeq.

Comments (2)

sathvikbhagavan avatar sathvikbhagavan commented on July 3, 2024 1

Hello,

We can find the weights by accessing the nets parameter of the solver object and then its NN field (for a FCNN object)(https://github.com/NeuroDiffGym/neurodiffeq/blob/master/neurodiffeq/networks.py#L6). This gives a torch.nn.Sequential object and its weights can easily be found out by indexing the layer and accessing weight field. For your given example,

solver_system.nets[0].NN[0].weight

The output I got when I ran the code:

Parameter containing:
tensor([[ 0.8768],
        [-0.6987],
        [-0.5978],
        [ 0.3867],
        [-0.3607],
        [-0.6576],
        [-0.4753],
        [-0.1397],
        [-0.6517],
        [ 0.4632],
        [-0.5898],
        [-0.3324],
        [ 0.8168],
        [-0.8792],
        [-0.7331],
        [-0.1540],
        [ 0.1956],
        [ 0.7815],
        [ 0.2859],
        [-0.6865],
        [ 0.8375],
        [ 0.8586],
        [-0.8746],
        [-0.5371],
        [-0.7475],
        [ 0.4840],
        [ 0.5717],
        [-0.1432],
        [ 0.2203],
        [-0.3002],
        [ 0.2296],
        [-0.3601]], requires_grad=True)

from neurodiffeq.

Arup-nit avatar Arup-nit commented on July 3, 2024

Hi dear @shuheng-liu is there any way to find value of weights?

from neurodiffeq.

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.