dacapo.gp.reject_if_empty ========================= .. py:module:: dacapo.gp.reject_if_empty Attributes ---------- .. autoapisummary:: dacapo.gp.reject_if_empty.logger Classes ------- .. autoapisummary:: dacapo.gp.reject_if_empty.RejectIfEmpty Module Contents --------------- .. py:data:: logger .. py:class:: RejectIfEmpty(gt=None, p=0.5, background=0) Reject batches based on the masked-in vs. masked-out ratio. .. attribute:: gt The gt array to use :type: :class:`ArrayKey`, optional .. attribute:: p The probability that we reject until gt is nonempty :type: ``float``, optional Method: setup: Set up the provider. provide: Provide a batch. .. py:attribute:: gt .. py:attribute:: p .. py:attribute:: background :value: 0 .. py:method:: setup() Set up the provider. :raises AssertionError: If only 1 upstream provider is supported. .. rubric:: Examples >>> setup() setup() .. py:method:: provide(request) Provides a batch of data, rejecting empty ground truth (gt) if requested. :param request: The request object containing the necessary information. :returns: The batch of data. :raises AssertionError: If the requested gt is not present in the request. .. rubric:: Examples >>> provide(request) provide(request)