docs.unity3d.com
  • Manual
  • Scripting API
  • Changelog
  • License
    Show / Hide Table of Contents
    • Unity.​Sentis
      • Alloc​Scope
      • Array​Tensor​Data
      • Backend​Type
      • Burst​Tensor​Data
      • Channel
      • Channel​Swizzle
      • Compute​Info
      • Compute​Shader​Singleton
      • Compute​Tensor​Data
      • Coord​Origin
      • CPUOps
      • Data​Type
      • Device​Type
      • Dim​Type
      • Execution​Context
      • Generic​Worker
      • GPUCommand​Buffer​Ops
      • GPUCompute​Ops
      • GPUPixel​Ops
      • IConvertible​To​Array​Tensor​Data
      • IConvertible​To​Burst​Tensor​Data
      • IConvertible​To​Compute​Tensor​Data
      • IDependable​Memory​Resource
      • IOps
      • ITensor​Allocator
      • ITensor​Data
      • IVars
      • IWorker
      • Model
      • Model.​Importer​Warning
      • Model.​Input
      • Model.​Opset​Description
      • Model.​Warning​Type
      • Model​Asset
      • Model​Asset​Data
      • Model​Asset​Extensions
      • Model​Asset​Weights​Data
      • Model​Extensions
      • Model​Loader
      • Native​Tensor​Array
      • Native​Tensor​Array​From​Managed​Array
      • Non​Deterministic​Output
      • Pixel​Shader​Singleton
      • Random
      • Shared​Array​Tensor​Data
      • Symbolic​Tensor​Dim
      • Symbolic​Tensor​Shape
      • Tensor
      • Tensor​Extensions
      • Tensor​Float
      • Tensor​Int
      • Tensor​Layout
      • Tensor​NDIterator
      • Tensor​Shape
      • Texture​Converter
      • Texture​Tensor​Data
      • Texture​Transform
      • Wait​For​Completion
      • Worker​Extensions
      • Worker​Factory
      • Worker​Factory.​Worker​Configuration
    • Unity.​Sentis.​Layers
      • Abs
      • Acos
      • Acosh
      • Activation
      • Add
      • And
      • Arg​Max
      • Arg​Min
      • Asin
      • Asinh
      • Atan
      • Atanh
      • Auto​Pad
      • Average​Pool
      • Axis​Normalization
      • Bernoulli
      • Broadcast
      • Cast
      • Cast​Like
      • Ceil
      • Celu
      • Center​Point​Box
      • Clip
      • Compress
      • Concat
      • Constant
      • Constant​Of​Shape
      • Conv
      • Conv2DTrans
      • Coord​Transform​Mode
      • Cos
      • Cosh
      • Cum​Sum
      • Dense
      • Depth​To​Space
      • Depth​To​Space​Mode
      • Div
      • Einsum
      • Elu
      • Equal
      • Erf
      • Exp
      • Expand
      • Flags
      • Flatten
      • Floor
      • Fusable​Activation
      • Fused​Activation
      • Gather
      • Gather​Elements
      • Gather​ND
      • Gelu
      • Global​Average​Pool
      • Global​Max​Pool
      • Greater
      • Greater​Or​Equal
      • Hardmax
      • Hard​Sigmoid
      • Hard​Swish
      • Identity
      • Instance​Normalization
      • Interpolation​Mode
      • Is​Inf
      • Is​Na​N
      • Layer
      • Leaky​Relu
      • Less
      • Less​Or​Equal
      • Log
      • Log​Softmax
      • LRN
      • LSTM
      • Mat​Mul
      • Mat​Mul2D
      • Max
      • Max​Pool
      • Mean
      • Min
      • Mod
      • Mul
      • Multinomial
      • Nearest​Mode
      • Neg
      • Non​Max​Suppression
      • Non​Zero
      • Not
      • One​Hot
      • Or
      • Pad
      • Pad​Mode
      • Pow
      • PRelu
      • Random​Layer
      • Random​Normal
      • Random​Normal​Like
      • Random​Uniform
      • Random​Uniform​Like
      • Range
      • Reciprocal
      • Reduce
      • Reduce​L1
      • Reduce​L2
      • Reduce​Log​Sum
      • Reduce​Log​Sum​Exp
      • Reduce​Max
      • Reduce​Mean
      • Reduce​Min
      • Reduce​Prod
      • Reduce​Sum
      • Reduce​Sum​Square
      • Relu
      • Relu6
      • Reshape
      • Resize
      • Rnn​Activation
      • Rnn​Direction
      • Rnn​Layout
      • Roi​Align
      • Roi​Pooling​Mode
      • Round
      • Scale​Bias
      • Scale​Mode
      • Scatter​Elements
      • Scatter​ND
      • Scatter​Reduction​Mode
      • Selu
      • Shape
      • Shrink
      • Sigmoid
      • Sign
      • Sin
      • Sinh
      • Size
      • Slice
      • Softmax
      • Softplus
      • Softsign
      • Space​To​Depth
      • Split
      • Sqrt
      • Square
      • Squeeze
      • Sub
      • Sum
      • Swish
      • Tan
      • Tanh
      • Thresholded​Relu
      • Tile
      • Top​K
      • Transpose
      • Trilu
      • Trilu​Mode
      • Unsqueeze
      • Where
      • Xor
    • Scripting API
    • Unity.​Sentis.​Layers
    • Leaky​Relu

    Class LeakyRelu

    Represents an element-wise LeakyRelu activation layer: f(x) = x if x >= 0, otherwise f(x) = alpha * x.

    Inheritance
    Object
    Layer
    Activation
    LeakyRelu
    Inherited Members
    Layer.inputs
    Layer.name
    Layer.outputs
    Layer.flags
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: Unity.Sentis.Layers
    Syntax
    [Serializable]
    public class LeakyRelu : Activation

    Constructors

    LeakyRelu(String, String, Single)

    Initializes and returns an instance of LeakyRelu activation layer.

    Declaration
    public LeakyRelu(string name, string input, float alpha = 0.01F)
    Parameters
    Type Name Description
    String name

    The name to use for the output tensor of the layer.

    String input

    The name to use for the input tensor of the layer.

    Single alpha

    The alpha value to use for the LeakyRelu activation function. The default value is 0.01.

    Fields

    alpha

    The alpha value to use for the LeakyRelu activation function.

    Declaration
    public float alpha
    Field Value
    Type Description
    Single

    Methods

    Execute(Tensor[], ExecutionContext)

    Executes the layer using the operations and variables from the ExecutionContext and returns the output tensor.

    If the layer has more than one output, output tensors are saved to variables.

    Declaration
    public override Tensor Execute(Tensor[] inputTensors, ExecutionContext ctx)
    Parameters
    Type Name Description
    Tensor[] inputTensors
    ExecutionContext ctx
    Returns
    Type Description
    Tensor
    Overrides
    Layer.Execute(Tensor[], ExecutionContext)

    ToString()

    Returns a string that represents the Layer.

    Declaration
    public override string ToString()
    Returns
    Type Description
    String
    Overrides
    Layer.ToString()

    Did you find this page useful? Please give it a rating:

    Thanks for rating this page!

    Report a problem on this page

    What kind of problem would you like to report?

    • This page needs code samples
    • Code samples do not work
    • Information is missing
    • Information is incorrect
    • Information is unclear or confusing
    • There is a spelling/grammar error on this page
    • Something else

    Thanks for letting us know! This page has been marked for review based on your feedback.

    If you have time, you can provide more information to help us fix the problem faster.

    Provide more information

    You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:

    You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:

    You've told us there is information missing from this page. Please tell us more about what's missing:

    You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:

    You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:

    You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:

    You've told us this page has a problem. Please tell us more about what's wrong:

    Thank you for helping to make the Unity documentation better!

    Your feedback has been submitted as a ticket for our documentation team to review.

    We are not able to reply to every ticket submitted.

    In This Article
    • Constructors
      • LeakyRelu(String, String, Single)
    • Fields
      • alpha
    • Methods
      • Execute(Tensor[], ExecutionContext)
      • ToString()
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023