def test_conv_channel(self): fake_image_list = split_eeg.split_eeg_signal_axes(FAKE_EEG_SIGNAL, split_dim=1) kernel_tensor, input_shape = \ concat_eeg.conv_eeg_signal_channel(fake_image_list, 256, 1) # check the size of the shape is equal to the concat size self.assertEqual(kernel_tensor.get_shape().as_list(), input_shape)
def test_conv_channel_time(self): # first split the eeg signal of (10, 256, 256, 1) to 256 * (10, 1, 256, 1) fake_image_list = split_eeg.split_eeg_signal_axes(FAKE_EEG_SIGNAL, split_dim=1) # then concat the eeg signal use 256 channel kernel index to (10, 256*5, 256, 1) kernel_tensor, input_shape = \ concat_eeg.conv_eeg_signal_channel(fake_image_list, 256, 1) self.assertEqual(kernel_tensor.get_shape().as_list(), [10, 256*5, 256, 4]) self.assertEqual(input_shape, [10, 256*5, 256, 4]) # then split the new eeg signal of (10, 1280, 256, 1) to 256 * (10, 1280, 1, 1) fake_image_list = split_eeg.split_eeg_signal_axes(kernel_tensor, split_dim=2) # then concat the eeg signal use 256 channel kernel index to (10, 256*5, 256*5, 1) kernel_tensor, input_shape = \ concat_eeg.conv_eeg_signal_time(fake_image_list, np.arange(0, 256)) # check the size of the shape is equal to the concat size self.assertEqual(kernel_tensor.get_shape().as_list(), [10, 256*5, 256*5, 4]) self.assertEqual(input_shape, [10, 256*5, 256*5, 4])
def test_conv_channel_time(self): # first split the eeg signal of (10, 256, 256, 1) to 256 * (10, 1, 256, 1) fake_image_list = split_eeg.split_eeg_signal_axes(FAKE_EEG_SIGNAL, split_dim=1) # then concat the eeg signal use 256 channel kernel index to (10, 256*5, 256, 1) kernel_tensor, input_shape = \ concat_eeg.conv_eeg_signal_channel(fake_image_list, 256, 1) self.assertEqual(kernel_tensor.get_shape().as_list(), [10, 256 * 5, 256, 4]) self.assertEqual(input_shape, [10, 256 * 5, 256, 4]) # then split the new eeg signal of (10, 1280, 256, 1) to 256 * (10, 1280, 1, 1) fake_image_list = split_eeg.split_eeg_signal_axes(kernel_tensor, split_dim=2) # then concat the eeg signal use 256 channel kernel index to (10, 256*5, 256*5, 1) kernel_tensor, input_shape = \ concat_eeg.conv_eeg_signal_time(fake_image_list, np.arange(0, 256)) # check the size of the shape is equal to the concat size self.assertEqual(kernel_tensor.get_shape().as_list(), [10, 256 * 5, 256 * 5, 4]) self.assertEqual(input_shape, [10, 256 * 5, 256 * 5, 4])