org.dmg.pmml.NeuralLayer Maven / Gradle / Ivy
package org.dmg.pmml;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
import com.sun.xml.bind.Locatable;
import com.sun.xml.bind.annotation.XmlLocation;
import org.xml.sax.Locator;
/**
* Java class for anonymous complex type.
*
*
The following schema fragment specifies the expected content contained within this class.
*
*
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element ref="{http://www.dmg.org/PMML-4_2}Extension" maxOccurs="unbounded" minOccurs="0"/>
* <element ref="{http://www.dmg.org/PMML-4_2}Neuron" maxOccurs="unbounded"/>
* </sequence>
* <attribute name="numberOfNeurons" type="{http://www.w3.org/2001/XMLSchema}int" />
* <attribute name="activationFunction" type="{http://www.dmg.org/PMML-4_2}ACTIVATION-FUNCTION" />
* <attribute name="threshold" type="{http://www.dmg.org/PMML-4_2}REAL-NUMBER" />
* <attribute name="width" type="{http://www.dmg.org/PMML-4_2}REAL-NUMBER" />
* <attribute name="altitude" type="{http://www.dmg.org/PMML-4_2}REAL-NUMBER" />
* <attribute name="normalizationMethod" type="{http://www.dmg.org/PMML-4_2}NN-NORMALIZATION-METHOD" />
* </restriction>
* </complexContent>
* </complexType>
*
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"extensions",
"neurons"
})
@XmlRootElement(name = "NeuralLayer")
public class NeuralLayer
extends PMMLObject
implements Locatable, HasExtensions
{
@XmlElement(name = "Extension")
protected List extensions;
@XmlElement(name = "Neuron", required = true)
protected List neurons;
@XmlAttribute(name = "numberOfNeurons")
protected Integer numberOfNeurons;
@XmlAttribute(name = "activationFunction")
protected ActivationFunctionType activationFunction;
@XmlAttribute(name = "threshold")
protected Double threshold;
@XmlAttribute(name = "width")
protected Double width;
@XmlAttribute(name = "altitude")
protected Double altitude;
@XmlAttribute(name = "normalizationMethod")
protected NnNormalizationMethodType normalizationMethod;
@XmlLocation
@XmlTransient
protected Locator locator;
/**
* Gets the value of the extensions property.
*
*
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a set
method for the extensions property.
*
*
* For example, to add a new item, do as follows:
*
* getExtensions().add(newItem);
*
*
*
*
* Objects of the following type(s) are allowed in the list
* {@link Extension }
*
*
*/
public List getExtensions() {
if (extensions == null) {
extensions = new ArrayList();
}
return this.extensions;
}
/**
* Gets the value of the neurons property.
*
*
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a set
method for the neurons property.
*
*
* For example, to add a new item, do as follows:
*
* getNeurons().add(newItem);
*
*
*
*
* Objects of the following type(s) are allowed in the list
* {@link Neuron }
*
*
*/
public List getNeurons() {
if (neurons == null) {
neurons = new ArrayList();
}
return this.neurons;
}
/**
* Gets the value of the numberOfNeurons property.
*
* @return
* possible object is
* {@link Integer }
*
*/
public Integer getNumberOfNeurons() {
return numberOfNeurons;
}
/**
* Sets the value of the numberOfNeurons property.
*
* @param value
* allowed object is
* {@link Integer }
*
*/
public void setNumberOfNeurons(Integer value) {
this.numberOfNeurons = value;
}
/**
* Gets the value of the activationFunction property.
*
* @return
* possible object is
* {@link ActivationFunctionType }
*
*/
public ActivationFunctionType getActivationFunction() {
return activationFunction;
}
/**
* Sets the value of the activationFunction property.
*
* @param value
* allowed object is
* {@link ActivationFunctionType }
*
*/
public void setActivationFunction(ActivationFunctionType value) {
this.activationFunction = value;
}
/**
* Gets the value of the threshold property.
*
* @return
* possible object is
* {@link Double }
*
*/
public Double getThreshold() {
return threshold;
}
/**
* Sets the value of the threshold property.
*
* @param value
* allowed object is
* {@link Double }
*
*/
public void setThreshold(Double value) {
this.threshold = value;
}
/**
* Gets the value of the width property.
*
* @return
* possible object is
* {@link Double }
*
*/
public Double getWidth() {
return width;
}
/**
* Sets the value of the width property.
*
* @param value
* allowed object is
* {@link Double }
*
*/
public void setWidth(Double value) {
this.width = value;
}
/**
* Gets the value of the altitude property.
*
* @return
* possible object is
* {@link Double }
*
*/
public Double getAltitude() {
return altitude;
}
/**
* Sets the value of the altitude property.
*
* @param value
* allowed object is
* {@link Double }
*
*/
public void setAltitude(Double value) {
this.altitude = value;
}
/**
* Gets the value of the normalizationMethod property.
*
* @return
* possible object is
* {@link NnNormalizationMethodType }
*
*/
public NnNormalizationMethodType getNormalizationMethod() {
return normalizationMethod;
}
/**
* Sets the value of the normalizationMethod property.
*
* @param value
* allowed object is
* {@link NnNormalizationMethodType }
*
*/
public void setNormalizationMethod(NnNormalizationMethodType value) {
this.normalizationMethod = value;
}
public NeuralLayer withExtensions(Extension... values) {
if (values!= null) {
for (Extension value: values) {
getExtensions().add(value);
}
}
return this;
}
public NeuralLayer withExtensions(Collection values) {
if (values!= null) {
getExtensions().addAll(values);
}
return this;
}
public NeuralLayer withNeurons(Neuron... values) {
if (values!= null) {
for (Neuron value: values) {
getNeurons().add(value);
}
}
return this;
}
public NeuralLayer withNeurons(Collection values) {
if (values!= null) {
getNeurons().addAll(values);
}
return this;
}
public NeuralLayer withNumberOfNeurons(Integer value) {
setNumberOfNeurons(value);
return this;
}
public NeuralLayer withActivationFunction(ActivationFunctionType value) {
setActivationFunction(value);
return this;
}
public NeuralLayer withThreshold(Double value) {
setThreshold(value);
return this;
}
public NeuralLayer withWidth(Double value) {
setWidth(value);
return this;
}
public NeuralLayer withAltitude(Double value) {
setAltitude(value);
return this;
}
public NeuralLayer withNormalizationMethod(NnNormalizationMethodType value) {
setNormalizationMethod(value);
return this;
}
public Locator sourceLocation() {
return locator;
}
public void setSourceLocation(Locator newLocator) {
locator = newLocator;
}
@Override
public VisitorAction accept(Visitor visitor) {
VisitorAction status = visitor.visit(this);
for (int i = 0; (((status == VisitorAction.CONTINUE)&&(this.extensions!= null))&&(i