TransitionBlock

class ketos.neural_networks.densenet.TransitionBlock(*args, **kwargs)[source]

Transition Blocks for the DenseNet architecture

Args:
n_filters:int

Number of filters (i,e,: channels)

compression_factor: float

The compression factor used within the transition block (i.e.: the reduction of filters/channels from the previous dense block to the next)

dropout_rate:float

Dropout rate for the convolutional layer (between 0 and 1, use 0 for no dropout)

Methods

call(inputs[, training])

Calls the model on new inputs.

Attributes

activity_regularizer

Optional regularizer function for the output of this layer.

compute_dtype

The dtype of the layer's computations.

distribute_strategy

The tf.distribute.Strategy this model was created under.

dtype

The dtype of the layer weights.

dtype_policy

The dtype policy associated with this layer.

dynamic

Whether the layer is dynamic (eager-only); set in the constructor.

inbound_nodes

Deprecated, do NOT use! Only for compatibility with external Keras.

input

Retrieves the input tensor(s) of a layer.

input_mask

Retrieves the input mask tensor(s) of a layer.

input_shape

Retrieves the input shape(s) of a layer.

input_spec

InputSpec instance(s) describing the input format for this layer.

layers

losses

List of losses added using the add_loss() API.

metrics

Returns the model's metrics added using compile(), add_metric() APIs.

metrics_names

Returns the model's display labels for all outputs.

name

Name of the layer (string), set in the constructor.

name_scope

Returns a tf.name_scope instance for this class.

non_trainable_variables

Sequence of non-trainable variables owned by this module and its submodules.

non_trainable_weights

List of all non-trainable weights tracked by this layer.

outbound_nodes

Deprecated, do NOT use! Only for compatibility with external Keras.

output

Retrieves the output tensor(s) of a layer.

output_mask

Retrieves the output mask tensor(s) of a layer.

output_shape

Retrieves the output shape(s) of a layer.

run_eagerly

Settable attribute indicating whether the model should run eagerly.

state_updates

Deprecated, do NOT use!

stateful

submodules

Sequence of all sub-modules.

supports_masking

Whether this layer supports computing a mask using compute_mask.

trainable

trainable_variables

Sequence of trainable variables owned by this module and its submodules.

trainable_weights

List of all trainable weights tracked by this layer.

updates

variable_dtype

Alias of Layer.dtype, the dtype of the weights.

variables

Returns the list of all layer variables/weights.

weights

Returns the list of all layer variables/weights.

call(inputs, training=False)[source]

Calls the model on new inputs.

In this case call just reapplies all ops in the graph to the new inputs (e.g. build a new computational graph from the provided inputs).

Args:
inputs: Tensor or list of tensors

A tensor or list of tensors

training: Bool

Boolean or boolean scalar tensor, indicating whether to run the Network in training mode or inference mode.

Returns:

A tensor if there is a single output, or a list of tensors if there are more than one outputs.