Exemplo n.º 1
0
def _get_drop_mask(ops: Ops, nO: int, rate: Optional[float]) -> Optional[Floats1d]:
    if rate is not None:
        mask = ops.get_dropout_mask((nO,), rate)
        return mask  # type: ignore
    return None
Exemplo n.º 2
0
def _get_drop_mask(ops: Ops, nO: int,
                   rate: Optional[float]) -> Optional[Floats1d]:
    return ops.get_dropout_mask((nO, ), rate) if rate is not None else None