dmlc / MXNet.jl

MXNet Julia Package - flexible and efficient deep learning in Julia

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Queries regarding Symbolic API in MXNet in Julia

kishoreabhishek opened this issue · comments

I am struggling to understand the symbolic API nuances of MXNet in Julia. I saw an example in MXNet documentation which has the following line:
act1 = mx.Activation(data = fc1, name=:relu1, act_type=:relu)

Why is act_type assigned a symbol- :relu.
Is :relu a function pointer. If not then where do we assign the value to :relu symbol.
Why is data not assigned a symbol.
Why is name assigned a symbol rather than a string.

There is a difference between Symbols in Julia which are strings that start with : and are optimised representations of immutable strings and MXNet SymbolicNodes e.g. symbols in the python library.
We use Julia symbols in the API because they are a bit nicer to work with and we use them mostly to name things.

So the Symbol :relu in your example is used to switch the behaviour of the SymbolicNode mx.Activation.
data can be either a SymbolicNode or the name for a free input (like :data).

This issue tracker is primarily for bugs and for questions like this it is better to use https://discourse.julialang.org/c/domain/ML and tag your questions with mxnetjl.

Best,
-V