Hey guys,
Just as the title. I tried to search the Stack Overflow but I can't figure it out. I mean, how to choose the layer b.t. dense and Dense when I construct a neural network?
Please go to Stack Overflow for help and support:
https://stackoverflow.com/questions/tagged/tensorflow
If you open a GitHub issue, here is our policy:
Here's why we have that policy: TensorFlow developers respond to issues. We want to focus on work that benefits the whole community, e.g., fixing bugs and adding features. Support only helps individuals. GitHub also notifies thousands of people when issues are filed. We want them to see you communicating an interesting problem, rather than being redirected to Stack Overflow.
You can collect some of this information using our environment capture script:
https://github.com/tensorflow/tensorflow/tree/master/tools/tf_env_collect.sh
You can obtain the TensorFlow version with
python -c "import tensorflow as tf; print(tf.GIT_VERSION, tf.VERSION)"
Describe the problem clearly here. Be sure to convey here why it's a bug in TensorFlow or a feature request.
Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached. Try to provide a reproducible test case that is the bare minimum necessary to generate the problem.
tf.layers.Dense
returns an instance of class Dense
.
https://github.com/tensorflow/tensorflow/blob/9fa3d27c4bdd534eaff88ea2c4a7119e3174dbbf/tensorflow/python/layers/core.py#L116-L117
https://github.com/tensorflow/tensorflow/blob/9fa3d27c4bdd534eaff88ea2c4a7119e3174dbbf/tensorflow/python/layers/core.py#L174-L188
tf.layers.dense
first creates an instance of tf.layers.Dense
, then calls return layer.apply(inputs)
, which returns a tensor.
The same goes for:
tf.layers.Dropout
and tf.layers.dropout
tf.layers.Flatten
and tf.layers.flatten
tf.layers.AveragePooling1D
and tf.layers.average_pooling1d
Most helpful comment
https://github.com/tensorflow/tensorflow/blob/9fa3d27c4bdd534eaff88ea2c4a7119e3174dbbf/tensorflow/python/layers/core.py#L32-L33
tf.layers.Dense
returns an instance ofclass Dense
.https://github.com/tensorflow/tensorflow/blob/9fa3d27c4bdd534eaff88ea2c4a7119e3174dbbf/tensorflow/python/layers/core.py#L116-L117
https://github.com/tensorflow/tensorflow/blob/9fa3d27c4bdd534eaff88ea2c4a7119e3174dbbf/tensorflow/python/layers/core.py#L174-L188
tf.layers.dense
first creates an instance oftf.layers.Dense
, then callsreturn layer.apply(inputs)
, which returns a tensor.The same goes for:
tf.layers.Dropout
andtf.layers.dropout
tf.layers.Flatten
andtf.layers.flatten
tf.layers.AveragePooling1D
andtf.layers.average_pooling1d