Code Monkey home page Code Monkey logo

Comments (7)

francisco-munoz avatar francisco-munoz commented on July 17, 2024

Hi @kailashg26

Can you give me further information? What Hardware configuration file are you using? What tile configuration file? What layers are you trying to run?

from stonne.

kailashg26 avatar kailashg26 commented on July 17, 2024

Hello, I'm using it for maddpg -pytorch version
Here by, I attach th MLP model (IN place of Linear, I just did nn.SimulatedLinear and ran the algorithm. But I got the above error (I input the dogsandcats_tile_fc.txt). I'm using this hardware file (maeri_128mses_64_bw.cfg)
maddpg pytorch source code: https://github.com/shariqiqbal2810/maddpg-pytorch

class MLPNetwork(nn.Module):
    """
    MLP network (can be used as value or policy)
    """
    def __init__(self, input_dim, out_dim, hidden_dim=64, nonlin=F.relu,
                 constrain_out=False, norm_in=True, discrete_action=True):
        """
        Inputs:
            input_dim (int): Number of dimensions in input
            out_dim (int): Number of dimensions in output
            hidden_dim (int): Number of hidden dimensions
            nonlin (PyTorch function): Nonlinearity to apply to hidden layers
        """
        super(MLPNetwork, self).__init__()

        if norm_in:  # normalize inputs
            self.in_fn = nn.BatchNorm1d(input_dim)
            self.in_fn.weight.data.fill_(1)
            self.in_fn.bias.data.fill_(0)
        else:
            self.in_fn = lambda x: x
        self.fc1 = nn.Linear(input_dim, hidden_dim)#, '/home/kailash/Desktop/stonne/simulation_files/maeri_128mses_64_bw.cfg', 'dogsandcats_tile_fc.txt', sparsity_ratio=0.0)
        self.fc2 = nn.Linear(hidden_dim, hidden_dim)#, '/home/kailash/Desktop/stonne/simulation_files/maeri_128mses_64_bw.cfg', 'dogsandcats_tile_fc.txt', sparsity_ratio=0.0)
        self.fc3 = nn.Linear(hidden_dim, out_dim)#, '/home/kailash/Desktop/stonne/simulation_files/maeri_128mses_64_bw.cfg', 'dogsandcats_tile_fc.txt', sparsity_ratio=0.0)
        self.nonlin = nonlin
        if constrain_out and not discrete_action:
            # initialize small to prevent saturation
            self.fc3.weight.data.uniform_(-3e-3, 3e-3)
            self.out_fn = F.tanh
        else:  # logits for discrete action (will softmax later)
            self.out_fn = lambda x: x

    def forward(self, X):
        """
        Inputs:
            X (PyTorch Matrix): Batch of observations
        Outputs:
            out (PyTorch Matrix): Output of network (actions, values, etc)
        """
        h1 = self.nonlin(self.fc1(self.in_fn(X)))
        h2 = self.nonlin(self.fc2(h1))
        out = self.out_fn(self.fc3(h2))
        return out


from stonne.

francisco-munoz avatar francisco-munoz commented on July 17, 2024

Given the above error, I just note that it seems the interface cannot read the tile file (i.e., dogsandcat_tile_fc.txt). Are you sure you are including the file? You are not specifying any path to the file. Is it in your working directory? Remember you can find the file in minibenchmarks folder. Let me know if It works when indicating the whole path to the file.

from stonne.

kailashg26 avatar kailashg26 commented on July 17, 2024

Hello @francisco-munoz ,
The fix worked. Thanks. I just wanted to ask that if this simulator also works for training process? Because when I train maddpg, I used simulatedlinear for the three layers to start the training for 60k episodes and the lot of output files are generated. So, I wanted to know if my assumptions are right?

Thanks

from stonne.

francisco-munoz avatar francisco-munoz commented on July 17, 2024

Hi @kailashg26,
I am happy to hear that. Pytorch-simulator integration is done just for the forward pass. This means that probably you are just simulating the inference procedure of the training process. The backward pass of the training is not being simulated and is running on CPU.

from stonne.

kailashg26 avatar kailashg26 commented on July 17, 2024

Oh, okay, thanks @francisco-munoz. BTW great work!

from stonne.

francisco-munoz avatar francisco-munoz commented on July 17, 2024

Thanks @kailashg26 , really appreciated!!

from stonne.

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.