D-X-Y / AutoDL-Projects

Automated deep learning algorithms implemented in PyTorch.
MIT License
1.57k stars 282 forks source link

How to add a new operator/cell #63

Closed abduallahmohamed closed 4 years ago

abduallahmohamed commented 4 years ago

Hi,

Thanks for your work! I went through the paper and some areas of the code. If I want to define a new operator or cell, where is the best area of your code I should start with?

abduallahmohamed commented 4 years ago

I'm also interested in adding a choice for the operation, aka the operation could have multiple configurations.

Thanks

D-X-Y commented 4 years ago

You can add new operations at here: https://github.com/D-X-Y/AutoDL-Projects/blob/master/lib/models/cell_operations.py#L9. Besides, it is suggested that the new operation uses the same args as others. If so, it can be accessed in the model files.

abduallahmohamed commented 4 years ago

Thanks for your answer.

One more question, in cell_operations.py there's ResNetBasicblock,FactorizedReduce, PartAwareOp and GDAS_Reduction_Cell.

These cells use ReLUConvBN and some other operations. Are these cells fixed? does this means if I defined a new operator I should add it manually to these cells?

D-X-Y commented 4 years ago

Sorry, I did not fully understand your question. The cell is automatically constructed by the genotype. If you add a new op, you can add the name of your new op in genotype.

abduallahmohamed commented 4 years ago

I see, to make it clear: If I have a new operator or cell, I need to define the operator in cell_operations.py and I will need to add it to genotype.py is that right?

D-X-Y commented 4 years ago

yes.