dropout3d#

ivy.dropout3d(x, prob, /, *, training=True, data_format='NDHWC', out=None)[source]#

Randomly zero out entire channels with probability prob using samples from a Bernoulli distribution and the remaining channels are scaled by (1/1-prob). In this case, dropout3d performs a channel-wise dropout but assumes a channel is a 1D feature map.

Parameters:
  • x (Union[Array, NativeArray]) – a 4D or 5D input array. Should have a floating-point data type.

  • prob (float) – probability of a channel to be zero-ed.

  • training (bool, default: True) – controls whether dropout3d is performed during training or ignored during testing.

  • data_format (str, default: 'NDHWC') – “NDHWC” or “NCDHW”. Defaults to “NDHWC”.

  • out (Optional[Array], default: None) – optional output array, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Array

Returns:

  • ret

    an array with some channels zero-ed and the rest of channels are

    scaled by (1/1-prob).

  • Both the description and the type hints above assumes an array input for simplicity,

  • but this function is nestable, and therefore also accepts ivy.Container

  • instances in place of any of the arguments.

Array.dropout3d(self, prob, /, *, training=True, data_format='NDHWC', out=None)[source]#

ivy.Array instance method variant of ivy.dropout3d. This method simply wraps the function, and so the docstring for ivy.dropout3d also applies to this method with minimal changes.

Parameters:
  • self (Array) – The input array x to perform dropout on.

  • prob (float) – The probability of zeroing out each array element, float between 0 and 1.

  • training (bool, default: True) – Turn on dropout if training, turn off otherwise. Default is True.

  • data_format (str, default: 'NDHWC') – “NDHWC” or “NCDHW”. Default is "NDHWC".

  • out (Optional[Array], default: None) – optional output array, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Array

Returns:

ret – Result array of the output after dropout is performed.

Container.dropout3d(self, prob, /, *, training=True, data_format='NDHWC', key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#

ivy.Container instance method variant of ivy.dropout3d. This method simply wraps the function, and so the docstring for ivy.dropout3d also applies to this method with minimal changes.

Parameters:
  • self (Container) – The input container to perform dropout on.

  • prob (Union[float, Container]) – The probability of zeroing out each array element, float between 0 and 1.

  • training (Union[bool, Container], default: True) – Turn on dropout if training, turn off otherwise. Default is True.

  • data_format (Union[str, Container], default: 'NDHWC') – “NDHWC” or “NCDHW”. Default is "NDHWC".

  • key_chains (Optional[Union[List[str], Dict[str, str], Container]], default: None) – The key-chains to apply or not apply the method to. Default is None.

  • to_apply (Union[bool, Container], default: True) – If True, the method will be applied to key_chains, otherwise key_chains will be skipped. Default is True.

  • prune_unapplied (Union[bool, Container], default: False) – Whether to prune key_chains for which the function was not applied. Default is False.

  • map_sequences (Union[bool, Container], default: False) – Whether to also map method to sequences (lists, tuples). Default is False.

  • out (Optional[Container], default: None) – optional output array, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Container

Returns:

ret – Result container of the output after dropout is performed.