Pytorch Geometric gives me an 'edge_index' error - deep-learning

I am trying to use Pytorch Geometric on my own custom Dataset. However I keep getting this error "Please ensure that all indices in 'edge_index' point to valid indices in the interval [0, 13) in your node feature matrix and try again."
I checked that the max of edge_index is not greater than the number of nodes. Can anyone explain whats happening?
I have tried redoing my adjacency and edge_index matrices and I don't have this problem on InMemory datasets. Since I am making my own dataset, I see this error!

Related

Bayesian models for CNN using Pyro & Pytorch

I am applying a Bayesian model for a CNN that has many layers (more than 3), using Stochastic Variational Inference in Pyro Package.
However after defining the NN, Model and Guide functions and running the training loop I found that the loss stops decreasing on loss ~8000 (which is extremely high). I tried different learning rates and different optimization functions but non of them reaches a loss lower than 8000.
At last I changed the autoguide function (I tried AutoNormal, AutoGaussian, AutoBeta) they all stopped dicreasing the loss at the same point.
enter image description here
The last thing I did is trying the AutoMultivatiateNormal and for this it reached negative values (it reached -1) but when I looked at the weight matrices I found that they are all turned into scalers!!
The following graph represent the loss pattern for the AutoMultivatiateNormal
enter image description here
Do anyone knows how to solve such problem?? and why is this happening??

I want to resolve the “Error in diag(vcov(object)) : long vectors not supported yet: array.c:2192” error

I have done a multiple regression analysis in lmer.
So I wanted to calculate the confidence interval of the partial regression coefficient using confint(), and when I enter the following code, I get an error "
> confint(H2_FULL, method="Wald")
***Error in diag(vcov(object)) :
long vectors not supported yet: array.c:2192***
" and cannot run it.
Does anyone know how to resolve this error? Please help.
I am a beginner in R. I would appreciate it if you could help me to understand it clearly.
I only need to be able to calculate 95% confidence intervals for the partial regression coefficients of multiple regression analysis(multi-model).
I assume four explanatory variables, which is why I think this error was made.
This error did not occur in the single regression analysis.

An out of bounds index error when using Pytorch gather

I have Two Tensors
I am trying to gather one from each row with the column being specified by these indices. So I am trying to get:
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1]
This is my code for this:
self.manDistMat.gather(1, state.unsqueeze(-1)))
self.manDistMat
being the 16x16 matrix and state.unsqueeze(-1) being the other matrix.
When I try this I get this error.
RuntimeError: index 578437695752307201 is out of bounds for dimension 1 with size 16
What am I doing wrong?
I actually figured out it was cause I was indexing with a uint8 tensor. When I switched it to with .long() it worked. Can anyone explain why it has to be a long tensor?
I encountered the similar problem. It appears to be a bug in pytorch.

Error in solve.default(res$hessian*n.used,A): 'a' must be a complex matrix

I am using the arima function in R's forecast package and I get the following error:
Error in solve.default(res$hessian*n.used,A): 'a' must be a complex matrix
The time series that I am fitting has very large values numbers e.g. greater than 10 million. Can anyone please provide a solution that might alleviate this error? Would scaling the time series help?

A special loss function in caffe

I have a kind of euclidean loss function which is:
\sum_{i,j} c_i*max{0,y_{ji}-k_{ji}} + p_i*max{0,k_{ji}-y_{ji}}
which y_{ji} are the output of caffe and k_{ji} are the real output value, i is the index of the items and j is index of samples.
The issue is about getting the values of parameters c_i and p_i.
When I have c_i = c_q for all i \neq q, and similarly for p_i, I simply get the values of them as parameters of the loss layer (I added two new parameters in the caffe.proto). However, the problems is that now I have around 300 items so that it is not reasonable to get them as loss layer parameters.
I tried to get their values in the loss layer, I mean I tried to add another bottom layer for loss layer, but it gave an error.
I am stuck here!
Please guide me how I can solve this issue.
Thanks in advance,
Afshin