def test_eegresnet(input_sizes): model = EEGResNet( input_sizes['n_channels'], input_sizes['n_classes'], input_sizes['n_in_times'], final_pool_length=5, n_first_filters=2, ) check_forward_pass(model, input_sizes, only_check_until_dim=2)
def test_eegresnet(): rng = np.random.RandomState(42) n_channels = 18 n_in_times = 600 n_classes = 2 n_samples = 7 X = rng.randn(n_samples, n_channels, n_in_times, 1) X = torch.Tensor(X.astype(np.float32)) model = EEGResNet( n_channels, n_classes, n_in_times, final_pool_length=5, n_first_filters=2, ) y_pred = model(X) assert y_pred.shape[:2] == (n_samples, n_classes)