Skip to content

adding layer size calc to Neural Networkstutorial #498

Open
@nro-bot

Description

@nro-bot

It would have saved me a lot of wasted hours when moving from the tutorial to our own scenarios to explain the layer size calculation implicit in https://pytorch.org/tutorials/beginner/blitz/neural_networks_tutorial.html .

This was explained clearly in https://stackoverflow.com/questions/53784998/how-are-the-pytorch-dimensions-for-linear-layers-calculated

Could perhaps be a short addition to the "Note" section at the bottom?

(If that seems like a good solution / no one else gets to it, I should be able to get to this in mid-June)


Additionally: I don't think it belong in this tutorial tutorial, but there is a debugging tip that this common error message number is actually dependent on your batch size(!):
"RuntimeError: shape '[-1, 62500]' is invalid for input of size 11289600"
If you put in .view(-1, 11289600) the code will "run" further and then choke on the loss calculation; however, actually the original batch size issue has not been solved (as it should be set to 11289600 / batchsize), so attempting to address the loss error message does no good.

I'm not sure where this should go, but it's definitely pertinent for moving from the tutorial to real life (which the tutorials should give you the skills to do hopefully)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions