Class GradientDef.Builder

  • All Implemented Interfaces:
    Cloneable, org.nd4j.shade.protobuf.Message.Builder, org.nd4j.shade.protobuf.MessageLite.Builder, org.nd4j.shade.protobuf.MessageLiteOrBuilder, org.nd4j.shade.protobuf.MessageOrBuilder, GradientDefOrBuilder
    Enclosing class:
    GradientDef

    public static final class GradientDef.Builder
    extends org.nd4j.shade.protobuf.GeneratedMessageV3.Builder<GradientDef.Builder>
    implements GradientDefOrBuilder
     GradientDef defines the gradient function of a function defined in
     a function library.
     A gradient function g (specified by gradient_func) for a function f
     (specified by function_name) must follow the following:
     The function 'f' must be a numerical function which takes N inputs
     and produces M outputs. Its gradient function 'g', which is a
     function taking N + M inputs and produces N outputs.
     I.e. if we have
        (y1, y2, ..., y_M) = f(x1, x2, ..., x_N),
     then, g is
        (dL/dx1, dL/dx2, ..., dL/dx_N) = g(x1, x2, ..., x_N,
                                          dL/dy1, dL/dy2, ..., dL/dy_M),
     where L is a scalar-value function of (x1, x2, ..., xN) (e.g., the
     loss function). dL/dx_i is the partial derivative of L with respect
     to x_i.
     
    Protobuf type tensorflow.GradientDef
    • Method Detail

      • getDescriptor

        public static final org.nd4j.shade.protobuf.Descriptors.Descriptor getDescriptor()
      • internalGetFieldAccessorTable

        protected org.nd4j.shade.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Specified by:
        internalGetFieldAccessorTable in class org.nd4j.shade.protobuf.GeneratedMessageV3.Builder<GradientDef.Builder>
      • clear

        public GradientDef.Builder clear()
        Specified by:
        clear in interface org.nd4j.shade.protobuf.Message.Builder
        Specified by:
        clear in interface org.nd4j.shade.protobuf.MessageLite.Builder
        Overrides:
        clear in class org.nd4j.shade.protobuf.GeneratedMessageV3.Builder<GradientDef.Builder>
      • getDescriptorForType

        public org.nd4j.shade.protobuf.Descriptors.Descriptor getDescriptorForType()
        Specified by:
        getDescriptorForType in interface org.nd4j.shade.protobuf.Message.Builder
        Specified by:
        getDescriptorForType in interface org.nd4j.shade.protobuf.MessageOrBuilder
        Overrides:
        getDescriptorForType in class org.nd4j.shade.protobuf.GeneratedMessageV3.Builder<GradientDef.Builder>
      • getDefaultInstanceForType

        public GradientDef getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface org.nd4j.shade.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface org.nd4j.shade.protobuf.MessageOrBuilder
      • build

        public GradientDef build()
        Specified by:
        build in interface org.nd4j.shade.protobuf.Message.Builder
        Specified by:
        build in interface org.nd4j.shade.protobuf.MessageLite.Builder
      • buildPartial

        public GradientDef buildPartial()
        Specified by:
        buildPartial in interface org.nd4j.shade.protobuf.Message.Builder
        Specified by:
        buildPartial in interface org.nd4j.shade.protobuf.MessageLite.Builder
      • clone

        public GradientDef.Builder clone()
        Specified by:
        clone in interface org.nd4j.shade.protobuf.Message.Builder
        Specified by:
        clone in interface org.nd4j.shade.protobuf.MessageLite.Builder
        Overrides:
        clone in class org.nd4j.shade.protobuf.GeneratedMessageV3.Builder<GradientDef.Builder>
      • setField

        public GradientDef.Builder setField​(org.nd4j.shade.protobuf.Descriptors.FieldDescriptor field,
                                            Object value)
        Specified by:
        setField in interface org.nd4j.shade.protobuf.Message.Builder
        Overrides:
        setField in class org.nd4j.shade.protobuf.GeneratedMessageV3.Builder<GradientDef.Builder>
      • clearField

        public GradientDef.Builder clearField​(org.nd4j.shade.protobuf.Descriptors.FieldDescriptor field)
        Specified by:
        clearField in interface org.nd4j.shade.protobuf.Message.Builder
        Overrides:
        clearField in class org.nd4j.shade.protobuf.GeneratedMessageV3.Builder<GradientDef.Builder>
      • clearOneof

        public GradientDef.Builder clearOneof​(org.nd4j.shade.protobuf.Descriptors.OneofDescriptor oneof)
        Specified by:
        clearOneof in interface org.nd4j.shade.protobuf.Message.Builder
        Overrides:
        clearOneof in class org.nd4j.shade.protobuf.GeneratedMessageV3.Builder<GradientDef.Builder>
      • setRepeatedField

        public GradientDef.Builder setRepeatedField​(org.nd4j.shade.protobuf.Descriptors.FieldDescriptor field,
                                                    int index,
                                                    Object value)
        Specified by:
        setRepeatedField in interface org.nd4j.shade.protobuf.Message.Builder
        Overrides:
        setRepeatedField in class org.nd4j.shade.protobuf.GeneratedMessageV3.Builder<GradientDef.Builder>
      • addRepeatedField

        public GradientDef.Builder addRepeatedField​(org.nd4j.shade.protobuf.Descriptors.FieldDescriptor field,
                                                    Object value)
        Specified by:
        addRepeatedField in interface org.nd4j.shade.protobuf.Message.Builder
        Overrides:
        addRepeatedField in class org.nd4j.shade.protobuf.GeneratedMessageV3.Builder<GradientDef.Builder>
      • mergeFrom

        public GradientDef.Builder mergeFrom​(org.nd4j.shade.protobuf.Message other)
        Specified by:
        mergeFrom in interface org.nd4j.shade.protobuf.Message.Builder
        Overrides:
        mergeFrom in class org.nd4j.shade.protobuf.AbstractMessage.Builder<GradientDef.Builder>
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface org.nd4j.shade.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class org.nd4j.shade.protobuf.GeneratedMessageV3.Builder<GradientDef.Builder>
      • mergeFrom

        public GradientDef.Builder mergeFrom​(org.nd4j.shade.protobuf.CodedInputStream input,
                                             org.nd4j.shade.protobuf.ExtensionRegistryLite extensionRegistry)
                                      throws IOException
        Specified by:
        mergeFrom in interface org.nd4j.shade.protobuf.Message.Builder
        Specified by:
        mergeFrom in interface org.nd4j.shade.protobuf.MessageLite.Builder
        Overrides:
        mergeFrom in class org.nd4j.shade.protobuf.AbstractMessage.Builder<GradientDef.Builder>
        Throws:
        IOException
      • getFunctionNameBytes

        public org.nd4j.shade.protobuf.ByteString getFunctionNameBytes()
         The function name.
         
        string function_name = 1;
        Specified by:
        getFunctionNameBytes in interface GradientDefOrBuilder
        Returns:
        The bytes for functionName.
      • setFunctionName

        public GradientDef.Builder setFunctionName​(String value)
         The function name.
         
        string function_name = 1;
        Parameters:
        value - The functionName to set.
        Returns:
        This builder for chaining.
      • clearFunctionName

        public GradientDef.Builder clearFunctionName()
         The function name.
         
        string function_name = 1;
        Returns:
        This builder for chaining.
      • setFunctionNameBytes

        public GradientDef.Builder setFunctionNameBytes​(org.nd4j.shade.protobuf.ByteString value)
         The function name.
         
        string function_name = 1;
        Parameters:
        value - The bytes for functionName to set.
        Returns:
        This builder for chaining.
      • getGradientFuncBytes

        public org.nd4j.shade.protobuf.ByteString getGradientFuncBytes()
         The gradient function's name.
         
        string gradient_func = 2;
        Specified by:
        getGradientFuncBytes in interface GradientDefOrBuilder
        Returns:
        The bytes for gradientFunc.
      • setGradientFunc

        public GradientDef.Builder setGradientFunc​(String value)
         The gradient function's name.
         
        string gradient_func = 2;
        Parameters:
        value - The gradientFunc to set.
        Returns:
        This builder for chaining.
      • clearGradientFunc

        public GradientDef.Builder clearGradientFunc()
         The gradient function's name.
         
        string gradient_func = 2;
        Returns:
        This builder for chaining.
      • setGradientFuncBytes

        public GradientDef.Builder setGradientFuncBytes​(org.nd4j.shade.protobuf.ByteString value)
         The gradient function's name.
         
        string gradient_func = 2;
        Parameters:
        value - The bytes for gradientFunc to set.
        Returns:
        This builder for chaining.
      • setUnknownFields

        public final GradientDef.Builder setUnknownFields​(org.nd4j.shade.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        setUnknownFields in interface org.nd4j.shade.protobuf.Message.Builder
        Overrides:
        setUnknownFields in class org.nd4j.shade.protobuf.GeneratedMessageV3.Builder<GradientDef.Builder>
      • mergeUnknownFields

        public final GradientDef.Builder mergeUnknownFields​(org.nd4j.shade.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        mergeUnknownFields in interface org.nd4j.shade.protobuf.Message.Builder
        Overrides:
        mergeUnknownFields in class org.nd4j.shade.protobuf.GeneratedMessageV3.Builder<GradientDef.Builder>