Skip to content
Advertisement

Tag: machine-learning

Neural Machine Translation model predictions are off-by-one

Problem Summary In the following example, my NMT model has high loss because it correctly predicts target_input instead of target_output. As is evident, the prediction matches up almost 100% with target_input instead of target_output, as it should (off-by-one). Loss and gradients are being calculated using target_output, so it is strange that predictions are matching up to target_input. Model Overview An

how to get covariance matrix in tensorflow?

How could I get covariance matrix in tensorflow? Like numpy.cov() in numpy. For example, I want to get covariance matrix of tensor A, now I have to use numpy instead Is there anyway to get cov by tensorflow instead of numpy? It is differnet from the problem how to compute covariance in tensorflow, where their problem is to compute covariance

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:

Cross validation with grid search returns worse results than default

I’m using scikitlearn in Python to run some basic machine learning models. Using the built in GridSearchCV() function, I determined the “best” parameters for different techniques, yet many of these perform worse than the defaults. I include the default parameters as an option, so I’m surprised this would happen. For example: This is the same as the defaults, except max_depth

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

Advertisement