[keras] model methods and properties
阿新 • • 發佈:2018-12-09
Model(Container)
fit
evaluate
predict
train on batch # fit generator calls this func
test_on_batch
predict_on_batch
evaluate_generator
predict_generator
Container
class Container(Layer):
"""A Container is a directed acyclic graph of layers.
It is the topological form of a "model". A Model
is simply a Container with added training routines.
# Properties
name
inputs
outputs
input_layers
output_layers
input_spec (list of class instances)
each entry describes one required input:
- ndim
- dtype
trainable (boolean)
input_shape
output_shape
inbound_nodes: list of nodes
outbound_nodes: list of nodes
trainable_weights (list of variables)
non_trainable_weights (list of variables)
# Methods
summary
get_layer ###
get_weights
set_weights
get_config
compute_output_shape
# Class Methods
from_config
Layer
# Methods
call(x, mask=None): Where the layer's logic lives.
__call__(x, mask=None): Wrapper around the layer logic (`call`).
If x is a Keras tensor:
- Connect current layer with last layer from tensor:
`self._add_inbound_node(last_layer)`
- Add layer to tensor history
If layer is not built:
- Build from x._keras_shape
get_weights()
set_weights(weights)
get_config()
count_params()
compute_output_shape(input_shape)
compute_mask(x, mask)
get_input_at(node_index)
get_output_at(node_index)
get_input_shape_at(node_index)
get_output_shape_at(node_index)
get_input_mask_at(node_index)
get_output_mask_at(node_index)