apache / mxnet

Lightweight, Portable, Flexible Distributed/Mobile Deep Learning with Dynamic, Mutation-aware Dataflow Dep Scheduler; for Python, R, Julia, Scala, Go, Javascript and more
https://mxnet.apache.org
Apache License 2.0
20.78k stars 6.79k forks source link

Should gluon layer support **name** field? #14515

Open yangfly opened 5 years ago

yangfly commented 5 years ago

At present, the name of Gluon layer is automatically extended to xxx/operator0_fwd, based on name_scope, which embodies modularization and avoids naming conflicts. However, the name field is not currently supported, resulting in a lack of flexibility.

for example

gluon.nn.Conv2D(10, 3)  # xxx/conv0_fwd

Should Gluon layer also support custom name like Symbol. Internally, only layers without user defined name are automatically named.

gluon.nn.Conv2D(10, 3, name='conv1')

This feature is useful in the following scenarios

Welcome to this discussion!

mxnet-label-bot commented 5 years ago

Hey, this is the MXNet Label Bot. Thank you for submitting the issue! I will try and suggest some labels so that the appropriate MXNet community members can help resolve it. Here are my recommended labels: Gluon, Feature

wkcn commented 5 years ago

+1. I think it is necessary to support custom name for gluon block. For example, to implement a ResNet model, I would like to name the layers as the paper names. In addition, I have a pre-trained model for MXNet Symbol, and I need the consistent names of parameters to support Gluon Model.

wkcn commented 5 years ago

I try to add name filed for gluon block. However, it is a little complicated.

eureka7mt commented 5 years ago

You could try gluon.nn.Conv2D(10, 3, prefix='conv1_')

yangfly commented 5 years ago

@eureka7mt Thank you for your advice, but there are two drawbacks with prefix=name_.

image

djaym7 commented 4 years ago

following, request +1