03f07734648aa9843393f0ebf19c61c2a34c728e,cleverhans/utils_keras.py,KerasModelWrapper,fprop,#KerasModelWrapper#,182
Before Change
new_input = self.model.get_input_at(0)
// Make a new model that returns each of the layers as output
outnodes_last = [x_layer.get_output_at(-1) for x_layer in self.model.layers]
outnodes_first = [x_layer.get_output_at(0) for x_layer in self.model.layers]
if outnodes_last != outnodes_first:
warnings.warn("Mutiple output nodes detected, picking last ones as default."
"This could happen due to using of stacked model.")
After Change
warnings.warn("Abstract layer detected, picking last ouput node as default."
"This could happen due to using of stacked model.")
layer_outputs = []
// For those abstract model layers, return their last output node as default.
for x_layer in self.model.layers:
if x_layer.name not in abstract_layers:
layer_outputs.append(x_layer.output)
else:
layer_outputs.append(x_layer.get_output_at(-1))
self.keras_model = KerasModel(new_input, layer_outputs)
// and get the outputs for that model on the input x
outputs = self.keras_model(x)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 10
Instances Project Name: tensorflow/cleverhans
Commit Name: 03f07734648aa9843393f0ebf19c61c2a34c728e
Time: 2019-03-13
Author: haojie.d.yuan@gmail.com
File Name: cleverhans/utils_keras.py
Class Name: KerasModelWrapper
Method Name: fprop
Project Name: david-abel/simple_rl
Commit Name: fcab3b11c0096803616af4956e49c59be6466d88
Time: 2018-09-07
Author: yagneshrevar@gmail.com
File Name: simple_rl/tasks/navigation/NavigationWorldMDP.py
Class Name: NavigationWorldMDP
Method Name: sample_init_states
Project Name: commonsense/conceptnet5
Commit Name: f522e894852f28da0d6b9441ce8e49f486dfbc5f
Time: 2017-06-16
Author: joanna.teresa.duda@gmail.com
File Name: conceptnet5/vectors/transforms.py
Class Name:
Method Name: choose_small_vocabulary