DCASE-REPO / dcase2018_baseline

DCASE 2018 Baseline systems
MIT License
128 stars 78 forks source link

Task 1: Where does one start implementing their own model? #6

Closed danstowell closed 6 years ago

danstowell commented 6 years ago

It would be useful if the readme could give a pointer about what someone needs to change, if they wish to change the model. In the code I see model_parameter_list=param.get_path('learner.parameters.model.config') which appears to be where the actual neural net is defined, but I don't see a file specifying this, or how I would change the network.

The network must presumably be specified somewhere in this repos or perhaps in dcase_util? Or is implicit? It would be good to point out where a user of this code should look, to see/modify the architecture

toni-heittola commented 6 years ago

In README.md, there is some example under "Customizing parameters". Would that be any help?

danstowell commented 6 years ago

Oh I missed that - thanks. I have two suggestions:

  1. Make the readme a bit shorter, e.g. move the results out into a separate .md
  2. Instead of leaving the network definition implicit in the code (as I think it is now? I still don't know which script creates the definition), put an explicit model.yaml in the repository - would then be easy to find and hack
toni-heittola commented 6 years ago

Network is not defined in the code, it is defined in the parameter file > https://github.com/DCASE-REPO/dcase2018_baseline/blob/master/task1/task1a.yaml#L151

The network definition is read into a Dict and dcase_util.keras.create_sequential_model function is used to create Keras model with it (https://dcase-repo.github.io/dcase_util/generated/dcase_util.keras.create_sequential_model.html). This is happens here > https://github.com/DCASE-REPO/dcase2018_baseline/blob/master/task1/task1a.py#L749

danstowell commented 6 years ago

Ah yes, I did expect it to be in a YAML file but managed to miss that too - I searched the code for keywords like "Dense" but somehow that file wasn't searched - sorry for missing it.

It might be handy to mention the YAML in the "System description" section.

Would it be acceptable for people to modify that file directly? If so, that might be a simple starting point.

toni-heittola commented 6 years ago

Best option to start modifying the system is the mechanism described in the readme under "Customizing parameters" section. In this approach, one makes a new parameter file, and runs the system with this parameter file:

python task1a.py -p my_parameters.yaml

This way baseline and your own modifications are clearly separated. Of course one can modify directly the task1a.yaml file too if this feels easier :)

danstowell commented 6 years ago

Sure, but if one followed the instructions directly in the "Customising parameters" section, one gets an MLP, not the baseline... When I try to put a Task 3 version together, I'll try factoring out the model into a separate YAML, and suggest users could duplicate+edit that.

toni-heittola commented 6 years ago

I added in commit 31ace3bb437a8489fb32acb7084da41cf97949bc a few more examples how to extend system through parameters. The system supports quite flexible parameter overloading from these extra YAML files. Only Lists have to be redefined fully in the overloading parameter files, other values only when they are changed from the defaults.