EEGNet V4 is implemented using Braindecode version 0.8.1 and Skorch version 0.15. ## Model details ## Training details ## Get started with the Model ```python from braindecode.models import EEGNetv4 from huggingface_hub import hf_hub_download from skorch import NeuralNet import torch.nn as nn import torch as th path_params = hf_hub_download( repo_id='guido151/EEGNetv4', filename='EEGNetv4_Lee2019_ERP/params.pt', ) path_optimizer = hf_hub_download( repo_id='guido151/EEGNetv4', filename='EEGNetv4_Lee2019_ERP/optimizer.pt', ) path_history = hf_hub_download( repo_id='guido151/EEGNetv4', filename='EEGNetv4_Lee2019_ERP/history.json', ) path_criterion = hf_hub_download( repo_id='guido151/EEGNetv4', filename='EEGNetv4_Lee2019_ERP/criterion.pt', ) model = EEGNetv4( n_chans=19, n_outputs=2, n_times=128, ) net = NeuralNet( model, criterion=nn.CrossEntropyLoss(weight=th.tensor([1, 1])), ) net.initialize() net.load_params( path_params, path_optimizer, path_criterion, path_history, ) ``` ## Get the FID model ```python def get_fid_model(model: EEGNetv4) -> nn.Module: fid_model = deepcopy(model) for i in range(len(fid_model)): if i >= 14: fid_model[i] = Identity() fid_model.eval() for param in fid_model.parameters(): param.requires_grad = False return fid_model ``` ## Get the IS model ```python def get_is_model(model: EEGNetv4) -> nn.Module: is_model = deepcopy(model) is_model.eval() for param in is_model.parameters(): param.requires_grad = False return is_model ```