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.
As I mentioned in https://github.com/dmlc/MXNet.jl/issues/193
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).
Take a look at What is Cloud Computing? - Soft Cloud Tech which explains in a little bit more detail.
1 Like