From fc0e6988be798e689ac3bdbf9776d278e166f146 Mon Sep 17 00:00:00 2001 From: dengkaipeng Date: Wed, 30 Jan 2019 06:27:59 +0000 Subject: [PATCH] remove useless code in AttentionCluster --- fluid/PaddleCV/video/configs/attention_cluster.txt | 2 +- .../PaddleCV/video/models/attention_cluster/logistic_model.py | 4 +--- .../video/models/attention_cluster/shifting_attention.py | 1 - 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/fluid/PaddleCV/video/configs/attention_cluster.txt b/fluid/PaddleCV/video/configs/attention_cluster.txt index c9c3037b..6a0d79f2 100755 --- a/fluid/PaddleCV/video/configs/attention_cluster.txt +++ b/fluid/PaddleCV/video/configs/attention_cluster.txt @@ -1,7 +1,7 @@ [MODEL] name = "AttentionCluster" dataset = "YouTube-8M" -bone_nework = None +bone_network = None drop_rate = 0.5 feature_num = 2 feature_names = ['rgb', 'audio'] diff --git a/fluid/PaddleCV/video/models/attention_cluster/logistic_model.py b/fluid/PaddleCV/video/models/attention_cluster/logistic_model.py index 79c1a5f8..bbc3a803 100755 --- a/fluid/PaddleCV/video/models/attention_cluster/logistic_model.py +++ b/fluid/PaddleCV/video/models/attention_cluster/logistic_model.py @@ -3,12 +3,10 @@ import paddle.fluid as fluid class LogisticModel(object): - """Logistic model with L2 regularization.""" - + """Logistic model.""" def build_model(self, model_input, vocab_size, - l2_penalty=None, **unused_params): """Creates a logistic model. diff --git a/fluid/PaddleCV/video/models/attention_cluster/shifting_attention.py b/fluid/PaddleCV/video/models/attention_cluster/shifting_attention.py index 245a4465..c67baca4 100755 --- a/fluid/PaddleCV/video/models/attention_cluster/shifting_attention.py +++ b/fluid/PaddleCV/video/models/attention_cluster/shifting_attention.py @@ -18,7 +18,6 @@ class ShiftingAttentionModel(object): x_shape.stop_gradient = True flat_x = fluid.layers.reshape(x, shape=(-1, self.seg_num)) flat_softmax = fluid.layers.softmax(flat_x) - # return fluid.layers.reshape(flat_softmax, shape=(x.shape[0], self.n_att, -1), actual_shape=x_shape) return fluid.layers.reshape( flat_softmax, shape=x.shape, actual_shape=x_shape) -- GitLab