vlawhern / arl-eegmodels

This is the Army Research Laboratory (ARL) EEGModels Project: A Collection of Convolutional Neural Network (CNN) models for EEG signal classification, using Keras and Tensorflow
Other
1.14k stars 284 forks source link

Fix Max Constraint for Conv Layers #4

Closed robintibor closed 6 years ago

robintibor commented 6 years ago

Also noted in issues at https://github.com/vlawhern/arl-eegmodels/issues/1

vlawhern commented 6 years ago

This will need to be changed such that the max_norm axis is (0, 2, 3) as we're using the "channels_first" data format: (trials, filters, channels, samples).

For "channels_last" data format the max_norm axis is (0,1,2) as you say.

I'll probably make the change such that the axis depends on the users keras.json config in the future..

robintibor commented 6 years ago

Are you sure about it? I think the channels_last/channels_first only refers to where input channels are within 0,1,2 and output channels are always in dim 3? Looks like that to me at least: https://gist.github.com/robintibor/a8262ac69f9bde9c25257b5552ce9f86

vlawhern commented 6 years ago

Yes you're correct... my mistake. I double-checked it and the weights matrix at the convolutional layers is the same regardless of the data format (either channels_first or channels_last). Merging this in.

robintibor commented 6 years ago

Great! :+1: