RandomArrayLayer

RandomArrayLayer[dist]

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

RandomArrayLayer[dfunc]

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

Details and Options

Examples

open allclose all

Basic Examples  (2)

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

Sample a random vector:

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

Sample a random vector with given values for the mean:

Scope  (3)

Arguments  (2)

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

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

Create the same layer with custom input port names:

Sample random numbers with this layer:

Create a layer that draws integers in a given range:

Sample random integers with given upper bounds:

Ports  (1)

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

Sample a sequence of integers with different given lengths:

Applications  (2)

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

Apply the net to a matrix:

Apply the net to lists of different lengths:

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

Apply the net on an image:

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

Apply the random mask to some inputs:

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.

CMS

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

BibTeX

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

BibLaTeX

@online{reference.wolfram_2024_randomarraylayer, organization={Wolfram Research}, title={RandomArrayLayer}, year={2020}, url={https://reference.wolfram.com/language/ref/RandomArrayLayer.html}, note=[Accessed: 22-November-2024 ]}