Closed thisisjl closed 7 years ago
The system was designed originally mainly for MLP and therefore input_dim was used. I now updated the create_model method to use input_shape instead to allow more generic usage, see commit 9ec18d085d8baeec6c431169d7802ff47dbc16cf.
If you plan to extend the system for CNN, you need to make custom learner class which is inherited from SceneClassifierMLP
or EventDetectorMLP
class, and override some methods for your purpose. At the same time you can also override create_model
method.
I'm happy to make DCASE Framework more generic to accommodate extensions to state-of-the-art approaches, as long as they do not break the baseline system. Just make pull request once you stumble on too restrictive functionality.
Thanks for your time in making the changes.
In my particular case, I would like to use the audio waveform as the input to the neural network. I did some changes, but I am not sure they respect the framework. As I am skipping the feature extraction step and the loading of the pickle files, in application_core.py
. Then, I load batch by bacth the audio files directly to a model.fit_generator()
.
I did not make any pull request because I am sure this workflow could be better implemented to be integrated to your existing framework. But if you have any suggestion in the best way to approach this, I appreciate it.
Hi, I am following your format of defining the neural network architecture in the parameters file and letting
KerasMixin_create_model()
building it, because I think it is clever. In thecreate_model
function, the variable name to set up the dimension of the input data isinput_dim
.My network uses
Keras.layers.Conv1d
, which, when usinginput_dim
, creates a wrong number of parameters. When I use instead the parameterinput_shape
, the network is okay.I understand the fully connected network that you released as baseline is set up using
input_dim
, but I have checked that it can also be set up withinput_shape
(if the value is in a tuple). Therefore, I would like to know if there is a reason to useinput_dim
instead ofinput_shape
I copied below the summary of networks built with
input_dim
andinput_shape
.Fully connected networks
The first one is using
input_dim
as by default in your code. The second case is usinginput_shape
, but note that the value of this argument is the tuple (4400,). And the third is also usinginput_shape
with the tuple (4400,1) and the resulting number of arguments is wrong.Convolutional networks
In the first case, I am using
input_dim
as it would be by default in the code. Note the output dimension of the network and the number of parameters. And note also that in the Keras 2 APIinput_dim
has been deprecated.In the second case, commented out here, I use
input_shape = (4400,)
, but there is an error as Conv1d expects 3 dimensions and it is not possible to add the layer.In the third case, I use
input_shape=(4400,1)
and the resulting network is fine.Do you plan to keep
input_dim
and should I find a solution for my case or do you want to apply some changes to it? Thank you so much