WOLFRAM

represents a net layer that has no input and produces a random array from the univariate distribution dist.

uses the univariate distribution dfunc[input] for each input value.

Details and Options

Examples

open allclose all

Basic Examples  (2)Summary of the most common use cases

Create a layer that draws 3 samples from a unit normal distribution:

Out[1]=1

Sample a random vector:

Out[2]=2

Create a layer that draws samples from independent normal distributions whose means are determined by the input:

Out[1]=1

Sample a random vector with given values for the mean:

Out[2]=2

Scope  (3)Survey of the scope of standard use cases

Arguments  (2)

Create a layer that draws real numbers from independent normal distributions whose means and standard deviations are determined by the inputs:

Out[1]=1

Sample a random vector with given values for the mean and the standard deviation of the Gaussian distribution:

Out[2]=2

Create the same layer with custom input port names:

Out[3]=3

Sample random numbers with this layer:

Out[4]=4

Create a layer that draws integers in a given range:

Out[1]=1

Sample random integers with given upper bounds:

Out[2]=2

Ports  (1)

Create a layer that draws a sequence of bounded integers with the same length as a given input:

Out[165]=165

Sample a sequence of integers with different given lengths:

Out[2]=2

Applications  (2)Sample problems that can be solved with this function

Build a network that sums an array and a random vector drawn from a Gaussian distribution:

Out[1]=1

Apply the net to a matrix:

Apply the net to lists of different lengths:

Out[3]=3

Derive a network that adds noise to images, by attaching an input NetEncoder and an output NetDecoder:

Out[4]=4

Apply the net on an image:

Out[5]=5

Build a network that masks a vector of integers with a particular integer value, with a probability to switch a value of 0.3:

Out[1]=1

Apply the random mask to some inputs:

Out[2]=2
Wolfram Research (2020), RandomArrayLayer, Wolfram Language function, https://reference.wolfram.com/language/ref/RandomArrayLayer.html.
Wolfram Research (2020), RandomArrayLayer, Wolfram Language function, https://reference.wolfram.com/language/ref/RandomArrayLayer.html.

Text

Wolfram Research (2020), RandomArrayLayer, Wolfram Language function, https://reference.wolfram.com/language/ref/RandomArrayLayer.html.

Wolfram Research (2020), RandomArrayLayer, Wolfram Language function, https://reference.wolfram.com/language/ref/RandomArrayLayer.html.

CMS

Wolfram Language. 2020. "RandomArrayLayer." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/RandomArrayLayer.html.

Wolfram Language. 2020. "RandomArrayLayer." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/RandomArrayLayer.html.

APA

Wolfram Language. (2020). RandomArrayLayer. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/RandomArrayLayer.html

Wolfram Language. (2020). RandomArrayLayer. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/RandomArrayLayer.html

BibTeX

@misc{reference.wolfram_2025_randomarraylayer, author="Wolfram Research", title="{RandomArrayLayer}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/RandomArrayLayer.html}", note=[Accessed: 26-March-2025 ]}

@misc{reference.wolfram_2025_randomarraylayer, author="Wolfram Research", title="{RandomArrayLayer}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/RandomArrayLayer.html}", note=[Accessed: 26-March-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_randomarraylayer, organization={Wolfram Research}, title={RandomArrayLayer}, year={2020}, url={https://reference.wolfram.com/language/ref/RandomArrayLayer.html}, note=[Accessed: 26-March-2025 ]}

@online{reference.wolfram_2025_randomarraylayer, organization={Wolfram Research}, title={RandomArrayLayer}, year={2020}, url={https://reference.wolfram.com/language/ref/RandomArrayLayer.html}, note=[Accessed: 26-March-2025 ]}