// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: tribuo-classification-sgd.proto

package org.tribuo.classification.sgd.protos;

/**
 * <pre>
 *CRFParameters proto
 * </pre>
 *
 * Protobuf type {@code tribuo.classification.sgd.CRFParametersProto}
 */
public final class CRFParametersProto extends
    com.google.protobuf.GeneratedMessageV3 implements
    // @@protoc_insertion_point(message_implements:tribuo.classification.sgd.CRFParametersProto)
    CRFParametersProtoOrBuilder {
private static final long serialVersionUID = 0L;
  // Use CRFParametersProto.newBuilder() to construct.
  private CRFParametersProto(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }
  private CRFParametersProto() {
  }

  @java.lang.Override
  @SuppressWarnings({"unused"})
  protected java.lang.Object newInstance(
      UnusedPrivateParameter unused) {
    return new CRFParametersProto();
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet
  getUnknownFields() {
    return this.unknownFields;
  }
  private CRFParametersProto(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          case 8: {

            numFeatures_ = input.readInt32();
            break;
          }
          case 16: {

            numLabels_ = input.readInt32();
            break;
          }
          case 26: {
            org.tribuo.math.protos.TensorProto.Builder subBuilder = null;
            if (biases_ != null) {
              subBuilder = biases_.toBuilder();
            }
            biases_ = input.readMessage(org.tribuo.math.protos.TensorProto.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom(biases_);
              biases_ = subBuilder.buildPartial();
            }

            break;
          }
          case 34: {
            org.tribuo.math.protos.TensorProto.Builder subBuilder = null;
            if (featureLabelWeights_ != null) {
              subBuilder = featureLabelWeights_.toBuilder();
            }
            featureLabelWeights_ = input.readMessage(org.tribuo.math.protos.TensorProto.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom(featureLabelWeights_);
              featureLabelWeights_ = subBuilder.buildPartial();
            }

            break;
          }
          case 42: {
            org.tribuo.math.protos.TensorProto.Builder subBuilder = null;
            if (labelLabelWeights_ != null) {
              subBuilder = labelLabelWeights_.toBuilder();
            }
            labelLabelWeights_ = input.readMessage(org.tribuo.math.protos.TensorProto.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom(labelLabelWeights_);
              labelLabelWeights_ = subBuilder.buildPartial();
            }

            break;
          }
          default: {
            if (!parseUnknownField(
                input, unknownFields, extensionRegistry, tag)) {
              done = true;
            }
            break;
          }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(
          e).setUnfinishedMessage(this);
    } finally {
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }
  public static final com.google.protobuf.Descriptors.Descriptor
      getDescriptor() {
    return org.tribuo.classification.sgd.protos.TribuoClassificationSgd.internal_static_tribuo_classification_sgd_CRFParametersProto_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return org.tribuo.classification.sgd.protos.TribuoClassificationSgd.internal_static_tribuo_classification_sgd_CRFParametersProto_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            org.tribuo.classification.sgd.protos.CRFParametersProto.class, org.tribuo.classification.sgd.protos.CRFParametersProto.Builder.class);
  }

  public static final int NUMFEATURES_FIELD_NUMBER = 1;
  private int numFeatures_;
  /**
   * <code>int32 numFeatures = 1;</code>
   * @return The numFeatures.
   */
  @java.lang.Override
  public int getNumFeatures() {
    return numFeatures_;
  }

  public static final int NUMLABELS_FIELD_NUMBER = 2;
  private int numLabels_;
  /**
   * <code>int32 numLabels = 2;</code>
   * @return The numLabels.
   */
  @java.lang.Override
  public int getNumLabels() {
    return numLabels_;
  }

  public static final int BIASES_FIELD_NUMBER = 3;
  private org.tribuo.math.protos.TensorProto biases_;
  /**
   * <code>.tribuo.math.TensorProto biases = 3;</code>
   * @return Whether the biases field is set.
   */
  @java.lang.Override
  public boolean hasBiases() {
    return biases_ != null;
  }
  /**
   * <code>.tribuo.math.TensorProto biases = 3;</code>
   * @return The biases.
   */
  @java.lang.Override
  public org.tribuo.math.protos.TensorProto getBiases() {
    return biases_ == null ? org.tribuo.math.protos.TensorProto.getDefaultInstance() : biases_;
  }
  /**
   * <code>.tribuo.math.TensorProto biases = 3;</code>
   */
  @java.lang.Override
  public org.tribuo.math.protos.TensorProtoOrBuilder getBiasesOrBuilder() {
    return getBiases();
  }

  public static final int FEATURELABELWEIGHTS_FIELD_NUMBER = 4;
  private org.tribuo.math.protos.TensorProto featureLabelWeights_;
  /**
   * <code>.tribuo.math.TensorProto featureLabelWeights = 4;</code>
   * @return Whether the featureLabelWeights field is set.
   */
  @java.lang.Override
  public boolean hasFeatureLabelWeights() {
    return featureLabelWeights_ != null;
  }
  /**
   * <code>.tribuo.math.TensorProto featureLabelWeights = 4;</code>
   * @return The featureLabelWeights.
   */
  @java.lang.Override
  public org.tribuo.math.protos.TensorProto getFeatureLabelWeights() {
    return featureLabelWeights_ == null ? org.tribuo.math.protos.TensorProto.getDefaultInstance() : featureLabelWeights_;
  }
  /**
   * <code>.tribuo.math.TensorProto featureLabelWeights = 4;</code>
   */
  @java.lang.Override
  public org.tribuo.math.protos.TensorProtoOrBuilder getFeatureLabelWeightsOrBuilder() {
    return getFeatureLabelWeights();
  }

  public static final int LABELLABELWEIGHTS_FIELD_NUMBER = 5;
  private org.tribuo.math.protos.TensorProto labelLabelWeights_;
  /**
   * <code>.tribuo.math.TensorProto labelLabelWeights = 5;</code>
   * @return Whether the labelLabelWeights field is set.
   */
  @java.lang.Override
  public boolean hasLabelLabelWeights() {
    return labelLabelWeights_ != null;
  }
  /**
   * <code>.tribuo.math.TensorProto labelLabelWeights = 5;</code>
   * @return The labelLabelWeights.
   */
  @java.lang.Override
  public org.tribuo.math.protos.TensorProto getLabelLabelWeights() {
    return labelLabelWeights_ == null ? org.tribuo.math.protos.TensorProto.getDefaultInstance() : labelLabelWeights_;
  }
  /**
   * <code>.tribuo.math.TensorProto labelLabelWeights = 5;</code>
   */
  @java.lang.Override
  public org.tribuo.math.protos.TensorProtoOrBuilder getLabelLabelWeightsOrBuilder() {
    return getLabelLabelWeights();
  }

  private byte memoizedIsInitialized = -1;
  @java.lang.Override
  public final boolean isInitialized() {
    byte isInitialized = memoizedIsInitialized;
    if (isInitialized == 1) return true;
    if (isInitialized == 0) return false;

    memoizedIsInitialized = 1;
    return true;
  }

  @java.lang.Override
  public void writeTo(com.google.protobuf.CodedOutputStream output)
                      throws java.io.IOException {
    if (numFeatures_ != 0) {
      output.writeInt32(1, numFeatures_);
    }
    if (numLabels_ != 0) {
      output.writeInt32(2, numLabels_);
    }
    if (biases_ != null) {
      output.writeMessage(3, getBiases());
    }
    if (featureLabelWeights_ != null) {
      output.writeMessage(4, getFeatureLabelWeights());
    }
    if (labelLabelWeights_ != null) {
      output.writeMessage(5, getLabelLabelWeights());
    }
    unknownFields.writeTo(output);
  }

  @java.lang.Override
  public int getSerializedSize() {
    int size = memoizedSize;
    if (size != -1) return size;

    size = 0;
    if (numFeatures_ != 0) {
      size += com.google.protobuf.CodedOutputStream
        .computeInt32Size(1, numFeatures_);
    }
    if (numLabels_ != 0) {
      size += com.google.protobuf.CodedOutputStream
        .computeInt32Size(2, numLabels_);
    }
    if (biases_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(3, getBiases());
    }
    if (featureLabelWeights_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(4, getFeatureLabelWeights());
    }
    if (labelLabelWeights_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(5, getLabelLabelWeights());
    }
    size += unknownFields.getSerializedSize();
    memoizedSize = size;
    return size;
  }

  @java.lang.Override
  public boolean equals(final java.lang.Object obj) {
    if (obj == this) {
     return true;
    }
    if (!(obj instanceof org.tribuo.classification.sgd.protos.CRFParametersProto)) {
      return super.equals(obj);
    }
    org.tribuo.classification.sgd.protos.CRFParametersProto other = (org.tribuo.classification.sgd.protos.CRFParametersProto) obj;

    if (getNumFeatures()
        != other.getNumFeatures()) return false;
    if (getNumLabels()
        != other.getNumLabels()) return false;
    if (hasBiases() != other.hasBiases()) return false;
    if (hasBiases()) {
      if (!getBiases()
          .equals(other.getBiases())) return false;
    }
    if (hasFeatureLabelWeights() != other.hasFeatureLabelWeights()) return false;
    if (hasFeatureLabelWeights()) {
      if (!getFeatureLabelWeights()
          .equals(other.getFeatureLabelWeights())) return false;
    }
    if (hasLabelLabelWeights() != other.hasLabelLabelWeights()) return false;
    if (hasLabelLabelWeights()) {
      if (!getLabelLabelWeights()
          .equals(other.getLabelLabelWeights())) return false;
    }
    if (!unknownFields.equals(other.unknownFields)) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    hash = (37 * hash) + NUMFEATURES_FIELD_NUMBER;
    hash = (53 * hash) + getNumFeatures();
    hash = (37 * hash) + NUMLABELS_FIELD_NUMBER;
    hash = (53 * hash) + getNumLabels();
    if (hasBiases()) {
      hash = (37 * hash) + BIASES_FIELD_NUMBER;
      hash = (53 * hash) + getBiases().hashCode();
    }
    if (hasFeatureLabelWeights()) {
      hash = (37 * hash) + FEATURELABELWEIGHTS_FIELD_NUMBER;
      hash = (53 * hash) + getFeatureLabelWeights().hashCode();
    }
    if (hasLabelLabelWeights()) {
      hash = (37 * hash) + LABELLABELWEIGHTS_FIELD_NUMBER;
      hash = (53 * hash) + getLabelLabelWeights().hashCode();
    }
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static org.tribuo.classification.sgd.protos.CRFParametersProto parseFrom(
      java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static org.tribuo.classification.sgd.protos.CRFParametersProto parseFrom(
      java.nio.ByteBuffer data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static org.tribuo.classification.sgd.protos.CRFParametersProto parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static org.tribuo.classification.sgd.protos.CRFParametersProto parseFrom(
      com.google.protobuf.ByteString data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static org.tribuo.classification.sgd.protos.CRFParametersProto parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static org.tribuo.classification.sgd.protos.CRFParametersProto parseFrom(
      byte[] data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static org.tribuo.classification.sgd.protos.CRFParametersProto parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static org.tribuo.classification.sgd.protos.CRFParametersProto parseFrom(
      java.io.InputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input, extensionRegistry);
  }
  public static org.tribuo.classification.sgd.protos.CRFParametersProto parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseDelimitedWithIOException(PARSER, input);
  }
  public static org.tribuo.classification.sgd.protos.CRFParametersProto parseDelimitedFrom(
      java.io.InputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
  }
  public static org.tribuo.classification.sgd.protos.CRFParametersProto parseFrom(
      com.google.protobuf.CodedInputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static org.tribuo.classification.sgd.protos.CRFParametersProto parseFrom(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input, extensionRegistry);
  }

  @java.lang.Override
  public Builder newBuilderForType() { return newBuilder(); }
  public static Builder newBuilder() {
    return DEFAULT_INSTANCE.toBuilder();
  }
  public static Builder newBuilder(org.tribuo.classification.sgd.protos.CRFParametersProto prototype) {
    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
  }
  @java.lang.Override
  public Builder toBuilder() {
    return this == DEFAULT_INSTANCE
        ? new Builder() : new Builder().mergeFrom(this);
  }

  @java.lang.Override
  protected Builder newBuilderForType(
      com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    Builder builder = new Builder(parent);
    return builder;
  }
  /**
   * <pre>
   *CRFParameters proto
   * </pre>
   *
   * Protobuf type {@code tribuo.classification.sgd.CRFParametersProto}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
      // @@protoc_insertion_point(builder_implements:tribuo.classification.sgd.CRFParametersProto)
      org.tribuo.classification.sgd.protos.CRFParametersProtoOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return org.tribuo.classification.sgd.protos.TribuoClassificationSgd.internal_static_tribuo_classification_sgd_CRFParametersProto_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return org.tribuo.classification.sgd.protos.TribuoClassificationSgd.internal_static_tribuo_classification_sgd_CRFParametersProto_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              org.tribuo.classification.sgd.protos.CRFParametersProto.class, org.tribuo.classification.sgd.protos.CRFParametersProto.Builder.class);
    }

    // Construct using org.tribuo.classification.sgd.protos.CRFParametersProto.newBuilder()
    private Builder() {
      maybeForceBuilderInitialization();
    }

    private Builder(
        com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);
      maybeForceBuilderInitialization();
    }
    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3
              .alwaysUseFieldBuilders) {
      }
    }
    @java.lang.Override
    public Builder clear() {
      super.clear();
      numFeatures_ = 0;

      numLabels_ = 0;

      if (biasesBuilder_ == null) {
        biases_ = null;
      } else {
        biases_ = null;
        biasesBuilder_ = null;
      }
      if (featureLabelWeightsBuilder_ == null) {
        featureLabelWeights_ = null;
      } else {
        featureLabelWeights_ = null;
        featureLabelWeightsBuilder_ = null;
      }
      if (labelLabelWeightsBuilder_ == null) {
        labelLabelWeights_ = null;
      } else {
        labelLabelWeights_ = null;
        labelLabelWeightsBuilder_ = null;
      }
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor
        getDescriptorForType() {
      return org.tribuo.classification.sgd.protos.TribuoClassificationSgd.internal_static_tribuo_classification_sgd_CRFParametersProto_descriptor;
    }

    @java.lang.Override
    public org.tribuo.classification.sgd.protos.CRFParametersProto getDefaultInstanceForType() {
      return org.tribuo.classification.sgd.protos.CRFParametersProto.getDefaultInstance();
    }

    @java.lang.Override
    public org.tribuo.classification.sgd.protos.CRFParametersProto build() {
      org.tribuo.classification.sgd.protos.CRFParametersProto result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public org.tribuo.classification.sgd.protos.CRFParametersProto buildPartial() {
      org.tribuo.classification.sgd.protos.CRFParametersProto result = new org.tribuo.classification.sgd.protos.CRFParametersProto(this);
      result.numFeatures_ = numFeatures_;
      result.numLabels_ = numLabels_;
      if (biasesBuilder_ == null) {
        result.biases_ = biases_;
      } else {
        result.biases_ = biasesBuilder_.build();
      }
      if (featureLabelWeightsBuilder_ == null) {
        result.featureLabelWeights_ = featureLabelWeights_;
      } else {
        result.featureLabelWeights_ = featureLabelWeightsBuilder_.build();
      }
      if (labelLabelWeightsBuilder_ == null) {
        result.labelLabelWeights_ = labelLabelWeights_;
      } else {
        result.labelLabelWeights_ = labelLabelWeightsBuilder_.build();
      }
      onBuilt();
      return result;
    }

    @java.lang.Override
    public Builder clone() {
      return super.clone();
    }
    @java.lang.Override
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        java.lang.Object value) {
      return super.setField(field, value);
    }
    @java.lang.Override
    public Builder clearField(
        com.google.protobuf.Descriptors.FieldDescriptor field) {
      return super.clearField(field);
    }
    @java.lang.Override
    public Builder clearOneof(
        com.google.protobuf.Descriptors.OneofDescriptor oneof) {
      return super.clearOneof(oneof);
    }
    @java.lang.Override
    public Builder setRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        int index, java.lang.Object value) {
      return super.setRepeatedField(field, index, value);
    }
    @java.lang.Override
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        java.lang.Object value) {
      return super.addRepeatedField(field, value);
    }
    @java.lang.Override
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof org.tribuo.classification.sgd.protos.CRFParametersProto) {
        return mergeFrom((org.tribuo.classification.sgd.protos.CRFParametersProto)other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(org.tribuo.classification.sgd.protos.CRFParametersProto other) {
      if (other == org.tribuo.classification.sgd.protos.CRFParametersProto.getDefaultInstance()) return this;
      if (other.getNumFeatures() != 0) {
        setNumFeatures(other.getNumFeatures());
      }
      if (other.getNumLabels() != 0) {
        setNumLabels(other.getNumLabels());
      }
      if (other.hasBiases()) {
        mergeBiases(other.getBiases());
      }
      if (other.hasFeatureLabelWeights()) {
        mergeFeatureLabelWeights(other.getFeatureLabelWeights());
      }
      if (other.hasLabelLabelWeights()) {
        mergeLabelLabelWeights(other.getLabelLabelWeights());
      }
      this.mergeUnknownFields(other.unknownFields);
      onChanged();
      return this;
    }

    @java.lang.Override
    public final boolean isInitialized() {
      return true;
    }

    @java.lang.Override
    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      org.tribuo.classification.sgd.protos.CRFParametersProto parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (org.tribuo.classification.sgd.protos.CRFParametersProto) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }

    private int numFeatures_ ;
    /**
     * <code>int32 numFeatures = 1;</code>
     * @return The numFeatures.
     */
    @java.lang.Override
    public int getNumFeatures() {
      return numFeatures_;
    }
    /**
     * <code>int32 numFeatures = 1;</code>
     * @param value The numFeatures to set.
     * @return This builder for chaining.
     */
    public Builder setNumFeatures(int value) {
      
      numFeatures_ = value;
      onChanged();
      return this;
    }
    /**
     * <code>int32 numFeatures = 1;</code>
     * @return This builder for chaining.
     */
    public Builder clearNumFeatures() {
      
      numFeatures_ = 0;
      onChanged();
      return this;
    }

    private int numLabels_ ;
    /**
     * <code>int32 numLabels = 2;</code>
     * @return The numLabels.
     */
    @java.lang.Override
    public int getNumLabels() {
      return numLabels_;
    }
    /**
     * <code>int32 numLabels = 2;</code>
     * @param value The numLabels to set.
     * @return This builder for chaining.
     */
    public Builder setNumLabels(int value) {
      
      numLabels_ = value;
      onChanged();
      return this;
    }
    /**
     * <code>int32 numLabels = 2;</code>
     * @return This builder for chaining.
     */
    public Builder clearNumLabels() {
      
      numLabels_ = 0;
      onChanged();
      return this;
    }

    private org.tribuo.math.protos.TensorProto biases_;
    private com.google.protobuf.SingleFieldBuilderV3<
        org.tribuo.math.protos.TensorProto, org.tribuo.math.protos.TensorProto.Builder, org.tribuo.math.protos.TensorProtoOrBuilder> biasesBuilder_;
    /**
     * <code>.tribuo.math.TensorProto biases = 3;</code>
     * @return Whether the biases field is set.
     */
    public boolean hasBiases() {
      return biasesBuilder_ != null || biases_ != null;
    }
    /**
     * <code>.tribuo.math.TensorProto biases = 3;</code>
     * @return The biases.
     */
    public org.tribuo.math.protos.TensorProto getBiases() {
      if (biasesBuilder_ == null) {
        return biases_ == null ? org.tribuo.math.protos.TensorProto.getDefaultInstance() : biases_;
      } else {
        return biasesBuilder_.getMessage();
      }
    }
    /**
     * <code>.tribuo.math.TensorProto biases = 3;</code>
     */
    public Builder setBiases(org.tribuo.math.protos.TensorProto value) {
      if (biasesBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        biases_ = value;
        onChanged();
      } else {
        biasesBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     * <code>.tribuo.math.TensorProto biases = 3;</code>
     */
    public Builder setBiases(
        org.tribuo.math.protos.TensorProto.Builder builderForValue) {
      if (biasesBuilder_ == null) {
        biases_ = builderForValue.build();
        onChanged();
      } else {
        biasesBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     * <code>.tribuo.math.TensorProto biases = 3;</code>
     */
    public Builder mergeBiases(org.tribuo.math.protos.TensorProto value) {
      if (biasesBuilder_ == null) {
        if (biases_ != null) {
          biases_ =
            org.tribuo.math.protos.TensorProto.newBuilder(biases_).mergeFrom(value).buildPartial();
        } else {
          biases_ = value;
        }
        onChanged();
      } else {
        biasesBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     * <code>.tribuo.math.TensorProto biases = 3;</code>
     */
    public Builder clearBiases() {
      if (biasesBuilder_ == null) {
        biases_ = null;
        onChanged();
      } else {
        biases_ = null;
        biasesBuilder_ = null;
      }

      return this;
    }
    /**
     * <code>.tribuo.math.TensorProto biases = 3;</code>
     */
    public org.tribuo.math.protos.TensorProto.Builder getBiasesBuilder() {
      
      onChanged();
      return getBiasesFieldBuilder().getBuilder();
    }
    /**
     * <code>.tribuo.math.TensorProto biases = 3;</code>
     */
    public org.tribuo.math.protos.TensorProtoOrBuilder getBiasesOrBuilder() {
      if (biasesBuilder_ != null) {
        return biasesBuilder_.getMessageOrBuilder();
      } else {
        return biases_ == null ?
            org.tribuo.math.protos.TensorProto.getDefaultInstance() : biases_;
      }
    }
    /**
     * <code>.tribuo.math.TensorProto biases = 3;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        org.tribuo.math.protos.TensorProto, org.tribuo.math.protos.TensorProto.Builder, org.tribuo.math.protos.TensorProtoOrBuilder> 
        getBiasesFieldBuilder() {
      if (biasesBuilder_ == null) {
        biasesBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            org.tribuo.math.protos.TensorProto, org.tribuo.math.protos.TensorProto.Builder, org.tribuo.math.protos.TensorProtoOrBuilder>(
                getBiases(),
                getParentForChildren(),
                isClean());
        biases_ = null;
      }
      return biasesBuilder_;
    }

    private org.tribuo.math.protos.TensorProto featureLabelWeights_;
    private com.google.protobuf.SingleFieldBuilderV3<
        org.tribuo.math.protos.TensorProto, org.tribuo.math.protos.TensorProto.Builder, org.tribuo.math.protos.TensorProtoOrBuilder> featureLabelWeightsBuilder_;
    /**
     * <code>.tribuo.math.TensorProto featureLabelWeights = 4;</code>
     * @return Whether the featureLabelWeights field is set.
     */
    public boolean hasFeatureLabelWeights() {
      return featureLabelWeightsBuilder_ != null || featureLabelWeights_ != null;
    }
    /**
     * <code>.tribuo.math.TensorProto featureLabelWeights = 4;</code>
     * @return The featureLabelWeights.
     */
    public org.tribuo.math.protos.TensorProto getFeatureLabelWeights() {
      if (featureLabelWeightsBuilder_ == null) {
        return featureLabelWeights_ == null ? org.tribuo.math.protos.TensorProto.getDefaultInstance() : featureLabelWeights_;
      } else {
        return featureLabelWeightsBuilder_.getMessage();
      }
    }
    /**
     * <code>.tribuo.math.TensorProto featureLabelWeights = 4;</code>
     */
    public Builder setFeatureLabelWeights(org.tribuo.math.protos.TensorProto value) {
      if (featureLabelWeightsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        featureLabelWeights_ = value;
        onChanged();
      } else {
        featureLabelWeightsBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     * <code>.tribuo.math.TensorProto featureLabelWeights = 4;</code>
     */
    public Builder setFeatureLabelWeights(
        org.tribuo.math.protos.TensorProto.Builder builderForValue) {
      if (featureLabelWeightsBuilder_ == null) {
        featureLabelWeights_ = builderForValue.build();
        onChanged();
      } else {
        featureLabelWeightsBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     * <code>.tribuo.math.TensorProto featureLabelWeights = 4;</code>
     */
    public Builder mergeFeatureLabelWeights(org.tribuo.math.protos.TensorProto value) {
      if (featureLabelWeightsBuilder_ == null) {
        if (featureLabelWeights_ != null) {
          featureLabelWeights_ =
            org.tribuo.math.protos.TensorProto.newBuilder(featureLabelWeights_).mergeFrom(value).buildPartial();
        } else {
          featureLabelWeights_ = value;
        }
        onChanged();
      } else {
        featureLabelWeightsBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     * <code>.tribuo.math.TensorProto featureLabelWeights = 4;</code>
     */
    public Builder clearFeatureLabelWeights() {
      if (featureLabelWeightsBuilder_ == null) {
        featureLabelWeights_ = null;
        onChanged();
      } else {
        featureLabelWeights_ = null;
        featureLabelWeightsBuilder_ = null;
      }

      return this;
    }
    /**
     * <code>.tribuo.math.TensorProto featureLabelWeights = 4;</code>
     */
    public org.tribuo.math.protos.TensorProto.Builder getFeatureLabelWeightsBuilder() {
      
      onChanged();
      return getFeatureLabelWeightsFieldBuilder().getBuilder();
    }
    /**
     * <code>.tribuo.math.TensorProto featureLabelWeights = 4;</code>
     */
    public org.tribuo.math.protos.TensorProtoOrBuilder getFeatureLabelWeightsOrBuilder() {
      if (featureLabelWeightsBuilder_ != null) {
        return featureLabelWeightsBuilder_.getMessageOrBuilder();
      } else {
        return featureLabelWeights_ == null ?
            org.tribuo.math.protos.TensorProto.getDefaultInstance() : featureLabelWeights_;
      }
    }
    /**
     * <code>.tribuo.math.TensorProto featureLabelWeights = 4;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        org.tribuo.math.protos.TensorProto, org.tribuo.math.protos.TensorProto.Builder, org.tribuo.math.protos.TensorProtoOrBuilder> 
        getFeatureLabelWeightsFieldBuilder() {
      if (featureLabelWeightsBuilder_ == null) {
        featureLabelWeightsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            org.tribuo.math.protos.TensorProto, org.tribuo.math.protos.TensorProto.Builder, org.tribuo.math.protos.TensorProtoOrBuilder>(
                getFeatureLabelWeights(),
                getParentForChildren(),
                isClean());
        featureLabelWeights_ = null;
      }
      return featureLabelWeightsBuilder_;
    }

    private org.tribuo.math.protos.TensorProto labelLabelWeights_;
    private com.google.protobuf.SingleFieldBuilderV3<
        org.tribuo.math.protos.TensorProto, org.tribuo.math.protos.TensorProto.Builder, org.tribuo.math.protos.TensorProtoOrBuilder> labelLabelWeightsBuilder_;
    /**
     * <code>.tribuo.math.TensorProto labelLabelWeights = 5;</code>
     * @return Whether the labelLabelWeights field is set.
     */
    public boolean hasLabelLabelWeights() {
      return labelLabelWeightsBuilder_ != null || labelLabelWeights_ != null;
    }
    /**
     * <code>.tribuo.math.TensorProto labelLabelWeights = 5;</code>
     * @return The labelLabelWeights.
     */
    public org.tribuo.math.protos.TensorProto getLabelLabelWeights() {
      if (labelLabelWeightsBuilder_ == null) {
        return labelLabelWeights_ == null ? org.tribuo.math.protos.TensorProto.getDefaultInstance() : labelLabelWeights_;
      } else {
        return labelLabelWeightsBuilder_.getMessage();
      }
    }
    /**
     * <code>.tribuo.math.TensorProto labelLabelWeights = 5;</code>
     */
    public Builder setLabelLabelWeights(org.tribuo.math.protos.TensorProto value) {
      if (labelLabelWeightsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        labelLabelWeights_ = value;
        onChanged();
      } else {
        labelLabelWeightsBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     * <code>.tribuo.math.TensorProto labelLabelWeights = 5;</code>
     */
    public Builder setLabelLabelWeights(
        org.tribuo.math.protos.TensorProto.Builder builderForValue) {
      if (labelLabelWeightsBuilder_ == null) {
        labelLabelWeights_ = builderForValue.build();
        onChanged();
      } else {
        labelLabelWeightsBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     * <code>.tribuo.math.TensorProto labelLabelWeights = 5;</code>
     */
    public Builder mergeLabelLabelWeights(org.tribuo.math.protos.TensorProto value) {
      if (labelLabelWeightsBuilder_ == null) {
        if (labelLabelWeights_ != null) {
          labelLabelWeights_ =
            org.tribuo.math.protos.TensorProto.newBuilder(labelLabelWeights_).mergeFrom(value).buildPartial();
        } else {
          labelLabelWeights_ = value;
        }
        onChanged();
      } else {
        labelLabelWeightsBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     * <code>.tribuo.math.TensorProto labelLabelWeights = 5;</code>
     */
    public Builder clearLabelLabelWeights() {
      if (labelLabelWeightsBuilder_ == null) {
        labelLabelWeights_ = null;
        onChanged();
      } else {
        labelLabelWeights_ = null;
        labelLabelWeightsBuilder_ = null;
      }

      return this;
    }
    /**
     * <code>.tribuo.math.TensorProto labelLabelWeights = 5;</code>
     */
    public org.tribuo.math.protos.TensorProto.Builder getLabelLabelWeightsBuilder() {
      
      onChanged();
      return getLabelLabelWeightsFieldBuilder().getBuilder();
    }
    /**
     * <code>.tribuo.math.TensorProto labelLabelWeights = 5;</code>
     */
    public org.tribuo.math.protos.TensorProtoOrBuilder getLabelLabelWeightsOrBuilder() {
      if (labelLabelWeightsBuilder_ != null) {
        return labelLabelWeightsBuilder_.getMessageOrBuilder();
      } else {
        return labelLabelWeights_ == null ?
            org.tribuo.math.protos.TensorProto.getDefaultInstance() : labelLabelWeights_;
      }
    }
    /**
     * <code>.tribuo.math.TensorProto labelLabelWeights = 5;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        org.tribuo.math.protos.TensorProto, org.tribuo.math.protos.TensorProto.Builder, org.tribuo.math.protos.TensorProtoOrBuilder> 
        getLabelLabelWeightsFieldBuilder() {
      if (labelLabelWeightsBuilder_ == null) {
        labelLabelWeightsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            org.tribuo.math.protos.TensorProto, org.tribuo.math.protos.TensorProto.Builder, org.tribuo.math.protos.TensorProtoOrBuilder>(
                getLabelLabelWeights(),
                getParentForChildren(),
                isClean());
        labelLabelWeights_ = null;
      }
      return labelLabelWeightsBuilder_;
    }
    @java.lang.Override
    public final Builder setUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.setUnknownFields(unknownFields);
    }

    @java.lang.Override
    public final Builder mergeUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.mergeUnknownFields(unknownFields);
    }


    // @@protoc_insertion_point(builder_scope:tribuo.classification.sgd.CRFParametersProto)
  }

  // @@protoc_insertion_point(class_scope:tribuo.classification.sgd.CRFParametersProto)
  private static final org.tribuo.classification.sgd.protos.CRFParametersProto DEFAULT_INSTANCE;
  static {
    DEFAULT_INSTANCE = new org.tribuo.classification.sgd.protos.CRFParametersProto();
  }

  public static org.tribuo.classification.sgd.protos.CRFParametersProto getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<CRFParametersProto>
      PARSER = new com.google.protobuf.AbstractParser<CRFParametersProto>() {
    @java.lang.Override
    public CRFParametersProto parsePartialFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return new CRFParametersProto(input, extensionRegistry);
    }
  };

  public static com.google.protobuf.Parser<CRFParametersProto> parser() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.protobuf.Parser<CRFParametersProto> getParserForType() {
    return PARSER;
  }

  @java.lang.Override
  public org.tribuo.classification.sgd.protos.CRFParametersProto getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }

}

