2443550ee6915daf6e7ff6306f3dc2922752ea4b,vis/backend/tensorflow_backend.py,,modify_model_backprop,#Any#Any#,41
Before Change
// Restore original model to keep upstream callers unaffected.
idx = 0
for layer in model.layers[1:]:
if hasattr(layer, "activation"):
layer.activation = original_activations[idx]
idx += 1
// Register modifier.
modifier_fn = _BACKPROP_MODIFIERS.get(backprop_modifier)
if modifier_fn is None:
raise ValueError(""{}" modifier is not supported".format(backprop_modifier))
modifier_fn(backprop_modifier)
After Change
try:
// 1. Clone original model via save and load.
model.save(model_path)
modified_model = load_model(model_path)
// 2. Replace all possible activations with ReLU.
for i, layer in utils.reverse_enumerate(modified_model.layers):
if hasattr(layer, "activation"):
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 5
Instances Project Name: raghakot/keras-vis
Commit Name: 2443550ee6915daf6e7ff6306f3dc2922752ea4b
Time: 2017-07-09
Author: ragha@outlook.com
File Name: vis/backend/tensorflow_backend.py
Class Name:
Method Name: modify_model_backprop
Project Name: dmlc/dgl
Commit Name: 52c7ef49fcdf7f5f029c99e6db27e420a3621815
Time: 2019-10-25
Author: mufeili1996@gmail.com
File Name: examples/pytorch/model_zoo/chem/property_prediction/classification.py
Class Name:
Method Name: main
Project Name: fizyr/keras-retinanet
Commit Name: 6d68dca2aec44c5b1a73e6c9db5c5fbf6f731fd0
Time: 2018-09-11
Author: e.liscio@fizyr.com
File Name: keras_retinanet/bin/evaluate.py
Class Name:
Method Name: main
Project Name: RasaHQ/rasa
Commit Name: 4834536f529414c39f9d33b76f2197ef01dd939a
Time: 2018-08-08
Author: mr.voov@gmail.com
File Name: rasa_core/policies/keras_policy.py
Class Name: KerasPolicy
Method Name: load