1 # Copyright 2015 The TensorFlow Authors. All Rights Reserved. 2 # 3 # Licensed under the Apache License, Version 2.0 (the "License"); 4 # you may not use this file except in compliance with the License. 5 # You may obtain a copy of the License at 6 # 7 # http://www.apache.org/licenses/LICENSE-2.0 8 # 9 # Unless required by applicable law or agreed to in writing, software 10 # distributed under the License is distributed on an "AS IS" BASIS, 11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 # See the License for the specific language governing permissions and 13 # limitations under the License. 14 # ============================================================================= 15 16 # pylint: disable=unused-import,g-bad-import-order 17 """Neural network support. 18 19 See the @{$python/nn} guide. 20 21 @@relu 22 @@relu6 23 @@crelu 24 @@swish 25 @@elu 26 @@leaky_relu 27 @@selu 28 @@softplus 29 @@softsign 30 @@dropout 31 @@bias_add 32 @@sigmoid 33 @@log_sigmoid 34 @@tanh 35 @@convolution 36 @@conv2d 37 @@depthwise_conv2d 38 @@depthwise_conv2d_native 39 @@separable_conv2d 40 @@atrous_conv2d 41 @@atrous_conv2d_transpose 42 @@conv2d_transpose 43 @@conv1d 44 @@conv3d 45 @@conv3d_transpose 46 @@conv2d_backprop_filter 47 @@conv2d_backprop_input 48 @@conv3d_backprop_filter_v2 49 @@depthwise_conv2d_native_backprop_filter 50 @@depthwise_conv2d_native_backprop_input 51 @@avg_pool 52 @@max_pool 53 @@max_pool_with_argmax 54 @@avg_pool3d 55 @@max_pool3d 56 @@fractional_avg_pool 57 @@fractional_max_pool 58 @@pool 59 @@dilation2d 60 @@erosion2d 61 @@with_space_to_batch 62 @@l2_normalize 63 @@local_response_normalization 64 @@sufficient_statistics 65 @@normalize_moments 66 @@moments 67 @@weighted_moments 68 @@fused_batch_norm 69 @@batch_normalization 70 @@batch_norm_with_global_normalization 71 @@l2_loss 72 @@log_poisson_loss 73 @@sigmoid_cross_entropy_with_logits 74 @@softmax 75 @@log_softmax 76 @@softmax_cross_entropy_with_logits 77 @@softmax_cross_entropy_with_logits_v2 78 @@sparse_softmax_cross_entropy_with_logits 79 @@weighted_cross_entropy_with_logits 80 @@embedding_lookup 81 @@embedding_lookup_sparse 82 @@dynamic_rnn 83 @@bidirectional_dynamic_rnn 84 @@raw_rnn 85 @@static_rnn 86 @@static_state_saving_rnn 87 @@static_bidirectional_rnn 88 @@ctc_loss 89 @@ctc_greedy_decoder 90 @@ctc_beam_search_decoder 91 @@top_k 92 @@in_top_k 93 @@nce_loss 94 @@sampled_softmax_loss 95 @@uniform_candidate_sampler 96 @@log_uniform_candidate_sampler 97 @@learned_unigram_candidate_sampler 98 @@fixed_unigram_candidate_sampler 99 @@compute_accidental_hits 100 @@quantized_conv2d 101 @@quantized_relu_x 102 @@quantized_max_pool 103 @@quantized_avg_pool 104 """ 105 from __future__ import absolute_import 106 from __future__ import division 107 from __future__ import print_function 108 109 import sys as _sys 110 111 # pylint: disable=unused-import 112 from tensorflow.python.ops import ctc_ops as _ctc_ops 113 from tensorflow.python.ops import embedding_ops as _embedding_ops 114 from tensorflow.python.ops import nn_grad as _nn_grad 115 from tensorflow.python.ops import nn_ops as _nn_ops 116 from tensorflow.python.ops.math_ops import sigmoid 117 from tensorflow.python.ops.math_ops import tanh 118 # pylint: enable=unused-import 119 from tensorflow.python.util.all_util import remove_undocumented 120 121 # Bring more nn-associated functionality into this package. 122 # go/tf-wildcard-import 123 # pylint: disable=wildcard-import,unused-import 124 from tensorflow.python.ops.ctc_ops import * 125 from tensorflow.python.ops.nn_impl import * 126 from tensorflow.python.ops.nn_ops import * 127 from tensorflow.python.ops.candidate_sampling_ops import * 128 from tensorflow.python.ops.embedding_ops import * 129 from tensorflow.python.ops.rnn import * 130 from tensorflow.python.ops import rnn_cell 131 # pylint: enable=wildcard-import,unused-import 132 133 134 # TODO(cwhipkey): sigmoid and tanh should not be exposed from tf.nn. 135 _allowed_symbols = [ 136 "zero_fraction", # documented in training.py 137 # Modules whitelisted for reference through tf.nn. 138 # TODO(cwhipkey): migrate callers to use the submodule directly. 139 # Symbols whitelisted for export without documentation. 140 # TODO(cwhipkey): review these and move to contrib or expose through 141 # documentation. 142 "all_candidate_sampler", # Excluded in gen_docs_combined. 143 "lrn", # Excluded in gen_docs_combined. 144 "relu_layer", # Excluded in gen_docs_combined. 145 "xw_plus_b", # Excluded in gen_docs_combined. 146 "rnn_cell", # rnn_cell is a submodule of tf.nn. 147 ] 148 149 remove_undocumented(__name__, _allowed_symbols, 150 [_sys.modules[__name__], _ctc_ops, _nn_ops, _nn_grad]) 151