/* * Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.sagemaker.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *

* Specifies ranges of integer, continuous, and categorical hyperparameters that a hyperparameter tuning job searches. * The hyperparameter tuning job launches training jobs with hyperparameter values within these ranges to find the * combination of values that result in the training job with the best performance as measured by the objective metric * of the hyperparameter tuning job. *

* *

* The maximum number of items specified for Array Members refers to the maximum number of hyperparameters * for each range and also the maximum for the hyperparameter tuning job itself. That is, the sum of the number of * hyperparameters for all the ranges can't exceed the maximum number specified. *

*
* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class ParameterRanges implements Serializable, Cloneable, StructuredPojo { /** *

* The array of * IntegerParameterRange objects that specify ranges of integer hyperparameters that a hyperparameter tuning job * searches. *

*/ private java.util.List integerParameterRanges; /** *

* The array of ContinuousParameterRange objects that specify ranges of continuous hyperparameters that a hyperparameter * tuning job searches. *

*/ private java.util.List continuousParameterRanges; /** *

* The array of CategoricalParameterRange objects that specify ranges of categorical hyperparameters that a hyperparameter * tuning job searches. *

*/ private java.util.List categoricalParameterRanges; /** *

* A list containing hyperparameter names and example values to be used by Autotune to determine optimal ranges for * your tuning job. *

*/ private java.util.List autoParameters; /** *

* The array of * IntegerParameterRange objects that specify ranges of integer hyperparameters that a hyperparameter tuning job * searches. *

* * @return The array of IntegerParameterRange objects that specify ranges of integer hyperparameters that a hyperparameter * tuning job searches. */ public java.util.List getIntegerParameterRanges() { return integerParameterRanges; } /** *

* The array of * IntegerParameterRange objects that specify ranges of integer hyperparameters that a hyperparameter tuning job * searches. *

* * @param integerParameterRanges * The array of IntegerParameterRange objects that specify ranges of integer hyperparameters that a hyperparameter * tuning job searches. */ public void setIntegerParameterRanges(java.util.Collection integerParameterRanges) { if (integerParameterRanges == null) { this.integerParameterRanges = null; return; } this.integerParameterRanges = new java.util.ArrayList(integerParameterRanges); } /** *

* The array of * IntegerParameterRange objects that specify ranges of integer hyperparameters that a hyperparameter tuning job * searches. *

*

* NOTE: This method appends the values to the existing list (if any). Use * {@link #setIntegerParameterRanges(java.util.Collection)} or * {@link #withIntegerParameterRanges(java.util.Collection)} if you want to override the existing values. *

* * @param integerParameterRanges * The array of IntegerParameterRange objects that specify ranges of integer hyperparameters that a hyperparameter * tuning job searches. * @return Returns a reference to this object so that method calls can be chained together. */ public ParameterRanges withIntegerParameterRanges(IntegerParameterRange... integerParameterRanges) { if (this.integerParameterRanges == null) { setIntegerParameterRanges(new java.util.ArrayList(integerParameterRanges.length)); } for (IntegerParameterRange ele : integerParameterRanges) { this.integerParameterRanges.add(ele); } return this; } /** *

* The array of * IntegerParameterRange objects that specify ranges of integer hyperparameters that a hyperparameter tuning job * searches. *

* * @param integerParameterRanges * The array of IntegerParameterRange objects that specify ranges of integer hyperparameters that a hyperparameter * tuning job searches. * @return Returns a reference to this object so that method calls can be chained together. */ public ParameterRanges withIntegerParameterRanges(java.util.Collection integerParameterRanges) { setIntegerParameterRanges(integerParameterRanges); return this; } /** *

* The array of ContinuousParameterRange objects that specify ranges of continuous hyperparameters that a hyperparameter * tuning job searches. *

* * @return The array of ContinuousParameterRange objects that specify ranges of continuous hyperparameters that a * hyperparameter tuning job searches. */ public java.util.List getContinuousParameterRanges() { return continuousParameterRanges; } /** *

* The array of ContinuousParameterRange objects that specify ranges of continuous hyperparameters that a hyperparameter * tuning job searches. *

* * @param continuousParameterRanges * The array of ContinuousParameterRange objects that specify ranges of continuous hyperparameters that a * hyperparameter tuning job searches. */ public void setContinuousParameterRanges(java.util.Collection continuousParameterRanges) { if (continuousParameterRanges == null) { this.continuousParameterRanges = null; return; } this.continuousParameterRanges = new java.util.ArrayList(continuousParameterRanges); } /** *

* The array of ContinuousParameterRange objects that specify ranges of continuous hyperparameters that a hyperparameter * tuning job searches. *

*

* NOTE: This method appends the values to the existing list (if any). Use * {@link #setContinuousParameterRanges(java.util.Collection)} or * {@link #withContinuousParameterRanges(java.util.Collection)} if you want to override the existing values. *

* * @param continuousParameterRanges * The array of ContinuousParameterRange objects that specify ranges of continuous hyperparameters that a * hyperparameter tuning job searches. * @return Returns a reference to this object so that method calls can be chained together. */ public ParameterRanges withContinuousParameterRanges(ContinuousParameterRange... continuousParameterRanges) { if (this.continuousParameterRanges == null) { setContinuousParameterRanges(new java.util.ArrayList(continuousParameterRanges.length)); } for (ContinuousParameterRange ele : continuousParameterRanges) { this.continuousParameterRanges.add(ele); } return this; } /** *

* The array of ContinuousParameterRange objects that specify ranges of continuous hyperparameters that a hyperparameter * tuning job searches. *

* * @param continuousParameterRanges * The array of ContinuousParameterRange objects that specify ranges of continuous hyperparameters that a * hyperparameter tuning job searches. * @return Returns a reference to this object so that method calls can be chained together. */ public ParameterRanges withContinuousParameterRanges(java.util.Collection continuousParameterRanges) { setContinuousParameterRanges(continuousParameterRanges); return this; } /** *

* The array of CategoricalParameterRange objects that specify ranges of categorical hyperparameters that a hyperparameter * tuning job searches. *

* * @return The array of CategoricalParameterRange objects that specify ranges of categorical hyperparameters that a * hyperparameter tuning job searches. */ public java.util.List getCategoricalParameterRanges() { return categoricalParameterRanges; } /** *

* The array of CategoricalParameterRange objects that specify ranges of categorical hyperparameters that a hyperparameter * tuning job searches. *

* * @param categoricalParameterRanges * The array of CategoricalParameterRange objects that specify ranges of categorical hyperparameters that a * hyperparameter tuning job searches. */ public void setCategoricalParameterRanges(java.util.Collection categoricalParameterRanges) { if (categoricalParameterRanges == null) { this.categoricalParameterRanges = null; return; } this.categoricalParameterRanges = new java.util.ArrayList(categoricalParameterRanges); } /** *

* The array of CategoricalParameterRange objects that specify ranges of categorical hyperparameters that a hyperparameter * tuning job searches. *

*

* NOTE: This method appends the values to the existing list (if any). Use * {@link #setCategoricalParameterRanges(java.util.Collection)} or * {@link #withCategoricalParameterRanges(java.util.Collection)} if you want to override the existing values. *

* * @param categoricalParameterRanges * The array of CategoricalParameterRange objects that specify ranges of categorical hyperparameters that a * hyperparameter tuning job searches. * @return Returns a reference to this object so that method calls can be chained together. */ public ParameterRanges withCategoricalParameterRanges(CategoricalParameterRange... categoricalParameterRanges) { if (this.categoricalParameterRanges == null) { setCategoricalParameterRanges(new java.util.ArrayList(categoricalParameterRanges.length)); } for (CategoricalParameterRange ele : categoricalParameterRanges) { this.categoricalParameterRanges.add(ele); } return this; } /** *

* The array of CategoricalParameterRange objects that specify ranges of categorical hyperparameters that a hyperparameter * tuning job searches. *

* * @param categoricalParameterRanges * The array of CategoricalParameterRange objects that specify ranges of categorical hyperparameters that a * hyperparameter tuning job searches. * @return Returns a reference to this object so that method calls can be chained together. */ public ParameterRanges withCategoricalParameterRanges(java.util.Collection categoricalParameterRanges) { setCategoricalParameterRanges(categoricalParameterRanges); return this; } /** *

* A list containing hyperparameter names and example values to be used by Autotune to determine optimal ranges for * your tuning job. *

* * @return A list containing hyperparameter names and example values to be used by Autotune to determine optimal * ranges for your tuning job. */ public java.util.List getAutoParameters() { return autoParameters; } /** *

* A list containing hyperparameter names and example values to be used by Autotune to determine optimal ranges for * your tuning job. *

* * @param autoParameters * A list containing hyperparameter names and example values to be used by Autotune to determine optimal * ranges for your tuning job. */ public void setAutoParameters(java.util.Collection autoParameters) { if (autoParameters == null) { this.autoParameters = null; return; } this.autoParameters = new java.util.ArrayList(autoParameters); } /** *

* A list containing hyperparameter names and example values to be used by Autotune to determine optimal ranges for * your tuning job. *

*

* NOTE: This method appends the values to the existing list (if any). Use * {@link #setAutoParameters(java.util.Collection)} or {@link #withAutoParameters(java.util.Collection)} if you want * to override the existing values. *

* * @param autoParameters * A list containing hyperparameter names and example values to be used by Autotune to determine optimal * ranges for your tuning job. * @return Returns a reference to this object so that method calls can be chained together. */ public ParameterRanges withAutoParameters(AutoParameter... autoParameters) { if (this.autoParameters == null) { setAutoParameters(new java.util.ArrayList(autoParameters.length)); } for (AutoParameter ele : autoParameters) { this.autoParameters.add(ele); } return this; } /** *

* A list containing hyperparameter names and example values to be used by Autotune to determine optimal ranges for * your tuning job. *

* * @param autoParameters * A list containing hyperparameter names and example values to be used by Autotune to determine optimal * ranges for your tuning job. * @return Returns a reference to this object so that method calls can be chained together. */ public ParameterRanges withAutoParameters(java.util.Collection autoParameters) { setAutoParameters(autoParameters); return this; } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getIntegerParameterRanges() != null) sb.append("IntegerParameterRanges: ").append(getIntegerParameterRanges()).append(","); if (getContinuousParameterRanges() != null) sb.append("ContinuousParameterRanges: ").append(getContinuousParameterRanges()).append(","); if (getCategoricalParameterRanges() != null) sb.append("CategoricalParameterRanges: ").append(getCategoricalParameterRanges()).append(","); if (getAutoParameters() != null) sb.append("AutoParameters: ").append(getAutoParameters()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ParameterRanges == false) return false; ParameterRanges other = (ParameterRanges) obj; if (other.getIntegerParameterRanges() == null ^ this.getIntegerParameterRanges() == null) return false; if (other.getIntegerParameterRanges() != null && other.getIntegerParameterRanges().equals(this.getIntegerParameterRanges()) == false) return false; if (other.getContinuousParameterRanges() == null ^ this.getContinuousParameterRanges() == null) return false; if (other.getContinuousParameterRanges() != null && other.getContinuousParameterRanges().equals(this.getContinuousParameterRanges()) == false) return false; if (other.getCategoricalParameterRanges() == null ^ this.getCategoricalParameterRanges() == null) return false; if (other.getCategoricalParameterRanges() != null && other.getCategoricalParameterRanges().equals(this.getCategoricalParameterRanges()) == false) return false; if (other.getAutoParameters() == null ^ this.getAutoParameters() == null) return false; if (other.getAutoParameters() != null && other.getAutoParameters().equals(this.getAutoParameters()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getIntegerParameterRanges() == null) ? 0 : getIntegerParameterRanges().hashCode()); hashCode = prime * hashCode + ((getContinuousParameterRanges() == null) ? 0 : getContinuousParameterRanges().hashCode()); hashCode = prime * hashCode + ((getCategoricalParameterRanges() == null) ? 0 : getCategoricalParameterRanges().hashCode()); hashCode = prime * hashCode + ((getAutoParameters() == null) ? 0 : getAutoParameters().hashCode()); return hashCode; } @Override public ParameterRanges clone() { try { return (ParameterRanges) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } @com.amazonaws.annotation.SdkInternalApi @Override public void marshall(ProtocolMarshaller protocolMarshaller) { com.amazonaws.services.sagemaker.model.transform.ParameterRangesMarshaller.getInstance().marshall(this, protocolMarshaller); } }