Skip to content
Advertisement

Tag: deep-learning

PyTorch Linear layer input dimension mismatch

Im getting this error when passing the input data to the Linear (Fully Connected Layer) in PyTorch: I fully understand the problem since the input data has a shape (N,C,H,W) (from a Convolutional+MaxPool layer) where: N: Data Samples C: Channels of the data H,W: Height and Width Nevertheless I was expecting PyTorch to do the “reshaping” of the data form:

How do you compute accuracy in a regression model, after rounding predictions to classes, in keras?

How would you create and display an accuracy metric in keras for a regression problem, for example after you round the predictions to the nearest integer class? While accuracy is not itself effectively defined conventionally for a regression problem, to determine ordinal classes/labels for data, it is suitable to treat the problem as a regression. But then it would be

tflearn / tensorflow does not learn xor

Following code was written to learn the XOR function, but about half of the time the network does not learn and the loss after each epoch stays the same. Sometimes I get correct results like this: But often this: My 2x2x1 network should be able to perform XOR, and there is even some evidence that suggests that this network should

Advertisement