The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

    AI::MXNet::Random - Handling of randomization in MXNet.

DESCRIPTION

    Handling of randomization in MXNet.

seed

    Seed the random number generators in mxnet.

    This seed will affect behavior of functions in this module,
    as well as results from executors that contains Random number
    such as Dropout operators.

    Parameters
    ----------
    $seed_state : int
        The random number seed.

    :$ctx : [Str|AI::MXNet::Context]
        The device context of the generator. The default Str is "all" which means seeding random
        number generators of all devices.
    Notes
    -----
    Random number generators in MXNet are device specific.
    mx->random->seed($seed_state) sets the state of each generator using $seed_state and the
    device id. Therefore, random numbers generated from different devices can be different
    even if they are seeded using the same seed.

    To produce identical random number sequences independent of the device id,
    set optional ctx argument. 
    For example mx->random->seed($seed_state, ctx => mx->gpu(0))
    This produces the same sequence of random numbers independent
    of the device id, but the sequence can be different on different kind of devices as MXNet's
    random number generators for CPU and GPU use different algorithms.