ResNetBlock¶
Inheritance Diagram

-
class
ashpy.models.convolutional.pix2pixhd.ResNetBlock(filters, normalization_layer=<class 'ashpy.layers.instance_normalization.InstanceNormalization'>, non_linearity=<class 'tensorflow.python.keras.layers.advanced_activations.ReLU'>, kernel_size=3, num_blocks=2)[source]¶ Bases:
tensorflow.python.keras.engine.training.ModelResNet Blocks: the input filters is the same as the output filters.
Methods
__init__(filters[, normalization_layer, …])ResNet block composed by num_blocks.
call(inputs[, training])Forward pass :param inputs: input tensor :param training: whether is training or not
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__(filters, normalization_layer=<class 'ashpy.layers.instance_normalization.InstanceNormalization'>, non_linearity=<class 'tensorflow.python.keras.layers.advanced_activations.ReLU'>, kernel_size=3, num_blocks=2)[source]¶ ResNet block composed by num_blocks. Each block is composed by
Conv2D with strides 1 and padding “same”
Normalization Layer
Non Linearity
The final result is the output of the ResNet + input
- Parameters
filters (int) – initial filters (same as the output filters)
normalization_layer (
tf.keras.layers.Layer) – layer of normalization used by the residual blocknon_linearity (
tf.keras.layers.Layer) – non linearity used in the resnet blockkernel_size (int) – kernel size used in the resnet block
num_blocks (int) – number of blocks, each block is composed by conv, normalization and non linearity
-