GlobalGenerator¶
Inheritance Diagram

-
class
ashpy.models.convolutional.pix2pixhd.GlobalGenerator(input_res=512, min_res=64, initial_filters=64, filters_cap=512, channels=3, normalization_layer=<class 'ashpy.layers.instance_normalization.InstanceNormalization'>, non_linearity=<class 'tensorflow.python.keras.layers.advanced_activations.ReLU'>, num_resnet_blocks=9, kernel_size_resnet=3, kernel_size_front_back=7, num_internal_resnet_blocks=2)[source]¶ Bases:
ashpy.models.convolutional.interfaces.Conv2DInterfaceGlobal Generator from pix2pixHD paper.
- G1^F: Convolutional frontend (downsampling)
- G1^R: ResNet Block
- G1^B: Convolutional backend (upsampling)
Methods
__init__([input_res, min_res, …])Global Generator from Pix2PixHD. call(inputs[, training])Call of the Pix2Pix HD model. 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__(input_res=512, min_res=64, initial_filters=64, filters_cap=512, channels=3, normalization_layer=<class 'ashpy.layers.instance_normalization.InstanceNormalization'>, non_linearity=<class 'tensorflow.python.keras.layers.advanced_activations.ReLU'>, num_resnet_blocks=9, kernel_size_resnet=3, kernel_size_front_back=7, num_internal_resnet_blocks=2)[source]¶ Global Generator from Pix2PixHD.
Parameters: - input_res (int) – Input Resolution.
- min_res (int) – Minimum resolution reached by the downsampling.
- initial_filters (int) – number of initial filters.
- filters_cap (int) – maximum number of filters.
- channels (int) – output channels.
- normalization_layer (
tf.keras.layers.Layer) – normalization layer used by the global generator, can be Instance Norm, Layer Norm, Batch Norm. - non_linearity (
tf.keras.layers.Layer) – non linearity used in the global generator. - num_resnet_blocks (int) – number of resnet blocks.
- kernel_size_resnet (int) – kernel size used in resnets conv layers.
- kernel_size_front_back (int) – kernel size used by the convolutional frontend and backend.
- num_internal_resnet_blocks (int) – number of blocks used by internal resnet.