FCNNEncoder¶
Inheritance Diagram

-
class
ashpy.models.convolutional.encoders.FCNNEncoder(layer_spec_input_res, layer_spec_target_res, kernel_size, initial_filters, filters_cap, encoding_dimension)[source]¶ Bases:
ashpy.models.convolutional.encoders.EncoderFully Convolutional Encoder.
Output a 1x1xencoding_size vector. The output neurons are linear.
Examples
Direct Usage:
dummy_generator = FCNNEncoder( layer_spec_input_res=(64, 64), layer_spec_target_res=(8, 8), kernel_size=5, initial_filters=4, filters_cap=128, encoding_dimension=100, ) print(dummy_generator(tf.zeros((1, 64, 64, 3))).shape)
(1, 1, 1, 100)
Methods
__init__(layer_spec_input_res, …)Instantiate the FCNNDecoder.Attributes
activity_regularizerOptional regularizer function for the output of this layer. dtypedynamicinbound_nodesDeprecated, do NOT use! Only for compatibility with external Keras. inputRetrieves the input tensor(s) of a layer. input_maskRetrieves the input mask tensor(s) of a layer. input_shapeRetrieves the input shape(s) of a layer. input_specGets the network’s input specs. layerslossesLosses which are associated with this Layer. metricsReturns the model’s metrics added using compile, add_metric APIs. metrics_namesReturns the model’s display labels for all outputs. nameReturns the name of this module as passed or determined in the ctor. name_scopeReturns a tf.name_scope instance for this class. non_trainable_variablesnon_trainable_weightsoutbound_nodesDeprecated, do NOT use! Only for compatibility with external Keras. outputRetrieves the output tensor(s) of a layer. output_maskRetrieves the output mask tensor(s) of a layer. output_shapeRetrieves the output shape(s) of a layer. run_eagerlySettable attribute indicating whether the model should run eagerly. sample_weightsstate_updatesReturns the updates from all layers that are stateful. statefulsubmodulesSequence of all sub-modules. trainabletrainable_variablesSequence of variables owned by this module and it’s submodules. trainable_weightsupdatesvariablesReturns the list of all layer variables/weights. weightsReturns the list of all layer variables/weights. -
__init__(layer_spec_input_res, layer_spec_target_res, kernel_size, initial_filters, filters_cap, encoding_dimension)[source]¶ Instantiate the
FCNNDecoder.Parameters: - layer_spec_input_res (
tupleof (int,int)) – Shape of the input tensors. - layer_spec_target_res – (
tupleof (int,int)): Shape of tensor desired as output of_get_layer_spec(). - kernel_size (int) – Kernel used by the convolution layers.
- initial_filters (int) – Numbers of filters to used as a base value.
- filters_cap (int) – Cap filters to a set amount, in the case of an Encoder is a ceil value AKA the max amount of filters.
- encoding_dimension (int) – encoding dimension.
Returns: Raises: ValueError– If filters_cap < initial_filters- layer_spec_input_res (
-
_add_final_block(output_shape)[source]¶ Prepare the results of
_add_building_block()for the final output.Parameters: output_shape (int) – Amount of units of the last tf.keras.layers.Dense