Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with Input format #562

Open
PortiefCreator opened this issue Dec 8, 2023 · 1 comment
Open

Problem with Input format #562

PortiefCreator opened this issue Dec 8, 2023 · 1 comment
Labels
basic Easier tasks question Further information is requested

Comments

@PortiefCreator
Copy link

Hello to the entire community, I am running some networks with this library on my EEG data. I hope you can help me:

With this configuration for my data I have an error:

File ~\AppData\Roaming\Python\Python310\site-packages\braindecode\experiments\experiment.py:303 in run_until_stop
self.monitor_epoch(datasets)

File ~\AppData\Roaming\Python\Python310\site-packages\braindecode\experiments\experiment.py:518 in monitor_epoch
self.epochs_df = self.epochs_df.append(row_dict, ignore_index=True)

File ~\anaconda3\lib\site-packages\pandas\core\generic.py:6204 in getattr
return object.getattribute(self, name)

AttributeError: 'DataFrame' object has no attribute 'append'
#############################################

this is my setup:

num_epochs = 300
net = Deep4Net(in_chans=8, n_classes=2, input_time_length=1000, final_conv_length='auto').cuda()

optimizer = AdamW(net.parameters(), lr=1*0.01, weight_decay=0.5*0.001)
net.compile(loss=F.nll_loss, optimizer=optimizer, iterator_seed=1, )

# Assuming train_data and labels_Train are PyTorch tensors
train_data_reshaped = train_data.reshape(-1,8, 1000).numpy()
labels_Train_np = labels_Train.numpy()


# Assuming train_data_reshaped is your reshaped EEG data
test_data_reshaped = test_data.reshape(-1, 8, 1000).numpy()
labels_Test_np=labels_Test.numpy()

# Now you can use the fit method
exp = net.fit(train_data_reshaped, labels_Train_np, epochs=100, batch_size=400, validation_data=(test_data_reshaped, labels_Test_np), remember_best_column='valid_loss')

What could be my mistake, the data format I think is correct, the panda library is update

@bruAristimunha
Copy link
Collaborator

Hey @PortiefCreator,

You need to create an EEGClassifier object and an EEG dataset from X and y. If you go deep into the tutorials, you can find this information.

@bruAristimunha bruAristimunha added question Further information is requested basic Easier tasks labels Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
basic Easier tasks question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants