Skip to content

Commit

Permalink
Bug fix of build docs (#439)
Browse files Browse the repository at this point in the history
  • Loading branch information
yangxudong authored Dec 13, 2023
1 parent ba60b9c commit e0980f1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@

version: 2

build:
os: ubuntu-22.04
tools:
python: "3.7"

sphinx:
configuration: docs/source/conf.py

Expand Down
6 changes: 4 additions & 2 deletions easy_rec/python/layers/common_layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,15 +171,17 @@ def call(self, config, training):
ln_name = self._group_name + 'f_%d' % i
fea = layer_norm(fea, name=ln_name, reuse=self._reuse)
if do_dropout and output_feature_list:
fea = self.dropout.apply(fea, training=training)
fea = self.dropout.call(fea, training=training)
if do_feature_dropout:
fea = tf.div(fea, keep_prob) * mask[i]
feature_list[i] = fea
if do_feature_dropout:
features = tf.concat(feature_list, axis=-1)

if do_dropout and not do_feature_dropout:
features = self.dropout.apply(features, training=training)
features = self.dropout.call(features, training=training)
if features.shape.ndims == 3 and int(features.shape[0]) == 1:
features = tf.squeeze(features, axis=0)

if config.only_output_feature_list:
return feature_list
Expand Down
6 changes: 5 additions & 1 deletion easy_rec/python/tools/feature_selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,11 @@ def _feature_dim_dropout_ratio(self):
group_name = feature_group.group_name

logit_p_name = 'logit_p' if group_name == 'all' else 'logit_p_%s' % group_name
logit_p = reader.get_tensor(logit_p_name)
try:
logit_p = reader.get_tensor(logit_p_name)
except Exception:
print('get `logit_p` failed, try to get `backbone/logit_p`')
logit_p = reader.get_tensor('backbone/' + logit_p_name)
feature_dims_importance = tf.sigmoid(logit_p)
with tf.Session() as sess:
feature_dims_importance = feature_dims_importance.eval(session=sess)
Expand Down

0 comments on commit e0980f1

Please sign in to comment.