Skip to content

Commit fe5af7b

Browse files
itsmeoliviatensorflower-gardener
authored andcommitted
removing deprecated functions
conv2d dropout and removing moving_average_decay Change: 133718900
1 parent 601b62a commit fe5af7b

8 files changed

Lines changed: 4 additions & 229 deletions

File tree

tensorflow/contrib/learn/BUILD

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -610,18 +610,6 @@ py_test(
610610
],
611611
)
612612

613-
py_test(
614-
name = "dropout_ops_test",
615-
size = "small",
616-
srcs = ["python/learn/ops/tests/dropout_ops_test.py"],
617-
srcs_version = "PY2AND3",
618-
deps = [
619-
":learn",
620-
"//tensorflow:tensorflow_py",
621-
"//tensorflow/python:framework_test_lib",
622-
],
623-
)
624-
625613
py_test(
626614
name = "seq2seq_ops_test",
627615
size = "small",

tensorflow/contrib/learn/python/learn/ops/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@
2222
# pylint: disable=wildcard-import
2323
from tensorflow.contrib.learn.python.learn.ops.array_ops import *
2424
from tensorflow.contrib.learn.python.learn.ops.autoencoder_ops import *
25-
from tensorflow.contrib.learn.python.learn.ops.conv_ops import *
2625
from tensorflow.contrib.learn.python.learn.ops.dnn_ops import *
27-
from tensorflow.contrib.learn.python.learn.ops.dropout_ops import *
2826
from tensorflow.contrib.learn.python.learn.ops.embeddings_ops import *
2927
from tensorflow.contrib.learn.python.learn.ops.losses_ops import *
3028
from tensorflow.contrib.learn.python.learn.ops.seq2seq_ops import *

tensorflow/contrib/learn/python/learn/ops/conv_ops.py

Lines changed: 0 additions & 84 deletions
This file was deleted.

tensorflow/contrib/learn/python/learn/ops/dnn_ops.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121

2222
from tensorflow.contrib import layers
2323
from tensorflow.contrib.framework.python.framework.deprecation import deprecated
24-
from tensorflow.contrib.learn.python.learn.ops import dropout_ops
2524

2625
from tensorflow.python.framework import ops
2726
from tensorflow.python.platform import tf_logging as logging

tensorflow/contrib/learn/python/learn/ops/dropout_ops.py

Lines changed: 0 additions & 59 deletions
This file was deleted.

tensorflow/contrib/learn/python/learn/ops/tests/dropout_ops_test.py

Lines changed: 0 additions & 50 deletions
This file was deleted.

tensorflow/contrib/learn/python/learn/ops/tests/ops_test.py

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import numpy as np
2222
import tensorflow as tf
2323

24+
from tensorflow.contrib.layers import conv2d
2425
from tensorflow.contrib.learn.python.learn import ops
2526

2627

@@ -70,23 +71,6 @@ def test_categorical_variable(self):
7071
self.assertEqual(emb1.shape, emb2.shape)
7172
self.assertAllEqual(np.transpose(emb2, axes=[1, 0, 2]), emb1)
7273

73-
def test_conv2d(self):
74-
tf.set_random_seed(42)
75-
batch_size = 32
76-
input_shape = (10, 10)
77-
n_filters = 7
78-
filter_shape = (5, 5)
79-
vals = np.random.randn(batch_size, input_shape[0], input_shape[1], 1)
80-
with self.test_session() as sess:
81-
tf.add_to_collection("IS_TRAINING", True)
82-
tensor_in = tf.placeholder(tf.float32, [batch_size, input_shape[0],
83-
input_shape[1], 1])
84-
res = ops.conv2d(tensor_in, n_filters, filter_shape, batch_norm=True)
85-
sess.run(tf.initialize_all_variables())
86-
conv = sess.run(res, feed_dict={tensor_in.name: vals})
87-
self.assertEqual(conv.shape, (batch_size, input_shape[0], input_shape[1],
88-
n_filters))
89-
9074
def test_one_hot_matrix(self):
9175
with self.test_session() as sess:
9276
tensor_in = tf.placeholder(tf.int64, [10, 2])

tensorflow/examples/skflow/text_classification_character_cnn.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434

3535
import tensorflow as tf
3636
from tensorflow.contrib import learn
37+
from tensorflow.contrib.layers import conv2d
3738

3839
FLAGS = tf.app.flags.FLAGS
3940
tf.app.flags.DEFINE_bool('test_with_fake_data', False,
@@ -54,8 +55,7 @@ def char_cnn_model(x, y):
5455
[-1, MAX_DOCUMENT_LENGTH, 256, 1])
5556
with tf.variable_scope('CNN_Layer1'):
5657
# Apply Convolution filtering on input sequence.
57-
conv1 = learn.ops.conv2d(byte_list, N_FILTERS,
58-
FILTER_SHAPE1, padding='VALID')
58+
conv1 = conv2d(byte_list, N_FILTERS, FILTER_SHAPE1, padding='VALID')
5959
# Add a RELU for non linearity.
6060
conv1 = tf.nn.relu(conv1)
6161
# Max pooling across output of Convolution+Relu.
@@ -65,8 +65,7 @@ def char_cnn_model(x, y):
6565
pool1 = tf.transpose(pool1, [0, 1, 3, 2])
6666
with tf.variable_scope('CNN_Layer2'):
6767
# Second level of convolution filtering.
68-
conv2 = learn.ops.conv2d(pool1, N_FILTERS, FILTER_SHAPE2,
69-
padding='VALID')
68+
conv2 = conv2d(pool1, N_FILTERS, FILTER_SHAPE2, padding='VALID')
7069
# Max across each filter to get useful features for classification.
7170
pool2 = tf.squeeze(tf.reduce_max(conv2, 1), squeeze_dims=[1])
7271

0 commit comments

Comments
 (0)