das.morpholayers.initializers#

class das.morpholayers.initializers.MinusOnes[source]#

Initializer that generates tensors initialized to -1.

Parameters

None

Returns

Initialized tensor.

Return type

tf.Tensor

class das.morpholayers.initializers.MinusOnesZeroCenter[source]#

Initializer that generates tensors initialized to -1 except for center value.

Parameters

None

Returns

Initialized tensor.

Return type

tf.Tensor

class das.morpholayers.initializers.Quadratic(tvalue=2, cvalue=0.2)[source]#

Initializer with quadratic values.

Parameters
  • tvalue (float) – T-value for distance transform.

  • cvalue (float) – Constant multiplier.

Returns

Initialized tensor.

Return type

tf.Tensor

get_config()[source]#

Returns the initializer’s configuration as a JSON-serializable dict.

Returns

A JSON-serializable Python dict.

class das.morpholayers.initializers.RandomLattice(minval=- 1, maxval=0, seed=None)[source]#

Initializer that generates tensors with a uniform distribution (MIN_LATT,MAX_LATT).

Parameters
  • minval (float) – Lower bound of the range of random values.

  • maxval (float) – Upper bound of the range of random values.

  • seed (int) – Seed for the random generator.

Returns

Initialized tensor.

Return type

tf.Tensor

get_config()[source]#

Returns the initializer’s configuration as a JSON-serializable dict.

Returns

A JSON-serializable Python dict.

class das.morpholayers.initializers.RandomLatticewithZero(minval=- 1, maxval=0)[source]#

Initializer that generates tensors with a uniform distribution (MIN_LATT,-MIN_LATT).

Parameters
  • minval (float) – Lower bound of the range of random values.

  • maxval (float) – Upper bound of the range of random values.

Returns

Initialized tensor.

Return type

tf.Tensor

get_config()[source]#

Returns the initializer’s configuration as a JSON-serializable dict.

Returns

A JSON-serializable Python dict.

class das.morpholayers.initializers.SEinitializer(SE=None, minval=None)[source]#

Initializer to a Structured Element (SE).

Parameters
  • SE (np.ndarray) – Structured Element.

  • minval (float) – Minimum value.

Returns

Initialized tensor.

Return type

tf.Tensor

class das.morpholayers.initializers.SignedOnes(minval=- 1, maxval=1, seed=None)[source]#

Initializer that generates tensors initialized to random -1 or 1 values.

Parameters
  • minval (float) – Lower bound of the range of random values.

  • maxval (float) – Upper bound of the range of random values.

  • seed (int) – Seed for the random generator.

Returns

Initialized tensor.

Return type

tf.Tensor

get_config()[source]#

Returns the initializer’s configuration as a JSON-serializable dict.

Returns

A JSON-serializable Python dict.

class das.morpholayers.initializers.SparseNumZeros(th=0)[source]#

Initializer that generates tensors initialized to MIN_LATT except for center value.

Parameters

th (int) – Number of zeros to generate.

Returns

Initialized tensor.

Return type

tf.Tensor

get_config()[source]#

Returns the initializer’s configuration as a JSON-serializable dict.

Returns

A JSON-serializable Python dict.

class das.morpholayers.initializers.SparseZeros(th=0.85)[source]#

Initializer that generates tensors initialized to MIN_LATT except for center value.

Parameters

th (float) – Threshold for generating sparse zeros.

Returns

Initialized tensor.

Return type

tf.Tensor

get_config()[source]#

Returns the initializer’s configuration as a JSON-serializable dict.

Returns

A JSON-serializable Python dict.