Coder Social home page Coder Social logo

Comments (4)

LiamMaclean216 avatar LiamMaclean216 commented on September 3, 2024

Could you explain further? Where are you using a random tensor? It could be your data is too difficult for the network, so it just gives the average value every time in order to minimize loss as much as it can.

from pytorch-transfomer.

LiuShaw avatar LiuShaw commented on September 3, 2024

Thanks for your reply! The examples you gave is to learn a sigmoid function. The input is [batch, 6, 1] and the output is [batch, 1]. I used my dataset, the input size is like [batch, 12, 10] and the target tensor size is [batch, 1, 10]. I have changed the parameters and train a model.
But when I test it, I found for all the different input, I got the similar output, even the input is a tensor with all the data is 1. So I tried small epochs to test. Then I found after the second epoch, the model I trained start output the similar result, as the picture shows(the target output(test dataset) is different). I have tried to fix it for more than 20days >_<.
image

So, I have changed the in and out tensor size. In addition to hyperparameters, where else should I adjust to make the model work?
Thank you!

from pytorch-transfomer.

LiamMaclean216 avatar LiamMaclean216 commented on September 3, 2024

It sounds like either the problem is too difficult for the network, or there is no correlation between inputs and outputs. Either one would cause the network to produce the average output (expected value) in an attempt to minimize loss, and ignore the inputs.

Adding more layers or widening layers may help. Also try training for more time, at least 100 epochs.

Could also be an error in the code somewhere, maybe the inputs got disconnected from the outputs somehow.

from pytorch-transfomer.

LiuShaw avatar LiuShaw commented on September 3, 2024

Thanks a lot. I have tried the official implementation by Pytorch, the problem is still remains. And the larger the epochs, the more likely it is to do so. I'll double check the code to see if there's a problem with it. My task is a multi-dim time series predict, maybe it could not be solved by Transformer fundamentally. Thank you again.

from pytorch-transfomer.

Related Issues (14)

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.