Skip to content

Commit

Permalink
Dropped support for tf.keras and eager execution
Browse files Browse the repository at this point in the history
  • Loading branch information
jernsting committed May 27, 2020
1 parent 9748a4b commit 1ca7976
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ python:
- 3.6
env:
- KERAS_BACKEND=tensorflow
- KERAS_BACKEND=tensorflow TF_KERAS=1
- KERAS_BACKEND=tensorflow TF_KERAS=1 TF_EAGER=1
- KERAS_BACKEND=tensorflow TF_KERAS=1 TF_2=1
# - KERAS_BACKEND=theano THEANO_FLAGS=optimizer=fast_compile
# - KERAS_BACKEND=cntk PYTHONWARNINGS=ignore
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
[![Build Status](https://travis-ci.com/jernsting/keras-drop-connect.svg?branch=master)](https://travis-ci.com/jernsting/keras-drop-connect)

![](https://img.shields.io/badge/keras-tensorflow-blue.svg)
![](https://img.shields.io/badge/keras-tf.keras-blue.svg)
![](https://img.shields.io/badge/keras-tf.keras/eager-blue.svg)
![](https://img.shields.io/badge/keras-tf.keras/2.0.0_beta-blue.svg)


Expand Down
13 changes: 6 additions & 7 deletions keras_drop_connect/wrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,16 @@ def _dropped_weight():
raise Exception("Unknown name: {}".format(name))
else:
pass
for name in names:
name = name.split("/")[1].split(":")[0] # this is not nice, but it works for now with all Versions
for name in dir(self.layer):
try:
w = getattr(self.layer, name)
origins[name] = w
if 0. < self.rate < 1.:
setattr(self.layer, name, K.in_train_phase(dropped_weight(w, self.rate), w,
training=training))
if K.is_keras_tensor(w) and w.name in names:
origins[name] = w
if 0. < self.rate < 1.:
setattr(self.layer, name, K.in_train_phase(dropped_weight(w, self.rate), w,
training=training))
except Exception as e:
continue

outputs = self.layer.call(inputs, **kwargs)
for name, w in origins.items():
setattr(self.layer, name, w)
Expand Down

0 comments on commit 1ca7976

Please sign in to comment.