I have data x of dimension (n_samples, time_steps, n_features) for the features and (n_samples, 1, n_labels) for the labels y.
From this I create a train, development and test pytorch datasets.
I want to use GridSearchCV to do a grid search on the…
I want to apply cross validation in Pytorch using skorch, so I prepared my model and my tensorDataset which returns (image,caption and captions_length) and so it has X and Y, so I'll not be able to set Y in the method
net.fit(dataset)
but when I…
I'm doing regression using Neural Networks. It should be a simple task for NN to do, I have 10 features and 1 output that I want to predict. I'm using pytorch for my project but my Model is not learning well. the loss start with a very high value…
I am trying to incorporate PyTorch functionalities into a scikit-learn environment (in particular Pipelines and GridSearchCV) and therefore have been looking into skorch. The standard documentation example for neural networks looks like
import…
I'm new to pytorch. I'm trying to do a cross validation, and I found the skorch library, which allow users to use sklearn functions with a torch model. So, I define a neural network class:
torch.manual_seed(42)
class Netcross(nn.Module):
def…
I want to use skorch to do multi-output regression. I've created a small toy example as can be seen below. In the example, the NN should predict 5 outputs. I also want to use a preprocessing step that is incorporated using sklearn pipelines (in this…
I'm using neural nets for a regression problem where I have 3 features and I'm trying to predict one continuous value. I noticed that my neural net start learning good but after 10 epochs it get stuck on a high loss value and could not improve…
I am attempting to learn skorch by translating a simple pytorch model that predicts the 2 digits contained in a set of MNIST multi digit pictures. These pictures contain 2 overlapping digits which are the output lables (y). I am getting the…
I have extended nn.Module to implement my network whose forward function is like this ...
def forward(self, X, **kwargs):
batch_size, seq_len = X.size()
length = kwargs['length']
embedded = self.embedding(X) # [batch_size, seq_len,…
I want to create my own dataset class based on Dataset class of Skorch because I want to differentiate categorical columns and continuous columns. These categorical columns will be passed through the embedding layers in the model. The result is…
I used skorch to train my model which is defined as below,
net_reg = NeuralNetRegressor(
Network_binaryDC,
batch_size=32,
lr=0.01,
max_epochs=1000,
criterion=nn.MSELoss,
optimizer=torch.optim.Adam,
train_split=None,
…
My skorch Neural Net GridsearchCV code is running, it just appears to not be on the GPU so it is slow.
Any help appreciated.
It takes 13 seconds per epoch. I know that pytorch runs much faster on the GPU.
Code:
import skorch
import torch
import…
Im trying to fit a model in PyTorch while using skorch. My problem is, that my model uses an LSTM layer, which expects 3d input and I don't know how to pass the input correctly.
When passing a 2d-array to fit() I get an error from PyTorch for the…
Using trainingData, which is a torch.utils.data.Dataset, throws an error about inconsistent lengths:
model = NeuralNetClassifier(
module=NN,
criterion=T.nn.BCELoss,
# optimizer=T.optim.Adam,
…