What is the difference between Symbol and Gluon? #14784
Replies: 2 comments
-
Q1: Generally speaking, you can do DL in both imperative or Symbolic ways. MXNet are supporting both of them. imperative way (NDArray) is more like running code from top to down. You will get the result from each layer you write. It's very convienient to debug. However, Symbolic way (Symbol) is done for performance, it will create a computation graph based on the code block you created and executed them in a single piece. And what you are thinking is right, Symbolic way is usually faster than imperative. Q2: Not fully, but mostly. We are covering 99% of them to make sure they can be used. Gluon is an abstract layer on the existing NDArray API in mxnet with a bunch of optimization. It designed to be imperative. The advantage point for Gluon is the bridge to convert a imperative model to symbolic model. By using Hybridize block and control-flow operator, you can easily convert a imperative implementation to a symbolic model in a second. So you don't have to write the model again in Symbolic ways (write in Symbol). I would recommend to make a start using Gluon APIs. |
Beta Was this translation helpful? Give feedback.
-
@lanking520 Very clear. Thank you very much, I will learn about gluon apis. In addition, I feel curious, what‘s official attitude to symbol api, will it be eliminated later or hidden ? |
Beta Was this translation helpful? Give feedback.
-
When I learned mxnet, I meet some confused question.
Question1 : I don’t know why there are two different apis. After read this topic I think gluon is a new api which supports dynamic graph, it’s easy to debug but slow, right?
Question2: Can these two apis be fully compatible? I am learning mxnet because my new team is using this framework, but it seems that they are tend to use the symbol api. Considering from cooperative perspective and application perspective, which api should I focus on?
Beta Was this translation helpful? Give feedback.
All reactions