看过前面的例子,会发现实现深度神经网络需要使用 tensorflow.nn 这个核心模块.我们通过源码来一探究竟. # Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. #
A quick glance through tensorflow/python/layers/core.py and tensorflow/python/ops/nn_ops.pyreveals that tf.layers.dropout is a wrapper for tf.nn.dropout. You want to use the dropout() function in tensorflow.contrib.layers, not the one in tensorflow.n