public abstract class AbstractZooModel
extends java.lang.Object
implements weka.core.OptionHandler, java.io.Serializable
Constructor and Description |
---|
AbstractZooModel() |
Modifier and Type | Method and Description |
---|---|
boolean |
getChannelsLast() |
org.deeplearning4j.nn.graph.ComputationGraph |
getDefaultGraph()
Convenience method to returns a default pretrained graph for this zoo model
|
java.lang.String[] |
getExtraLayersToRemove() |
java.lang.String |
getFeatureExtractionLayer() |
abstract org.nd4j.linalg.dataset.api.preprocessor.ImagePreProcessingScaler |
getImagePreprocessingScaler()
Get the preprocessor to process this model's data with
|
abstract int[] |
getInputShape()
Get the input shape of this zoomodel
|
int |
getNumFExtractOutputs() |
java.lang.String[] |
getOptions()
Gets the current settings of the Classifier.
|
java.lang.String |
getOutputlayer() |
PretrainedType |
getPretrainedType() |
java.lang.String |
getPrettyName() |
abstract java.lang.Enum |
getVariation()
Get the current variation of the zoo model (e.g., Resnet50 or Resnet101)
|
abstract org.deeplearning4j.nn.graph.ComputationGraph |
init(int numLabels,
long seed,
int[] shape,
boolean filterMode)
Initialize the ZooModel as MLP.
|
org.deeplearning4j.nn.graph.ComputationGraph |
initZooModel(org.deeplearning4j.zoo.ZooModel zooModel,
org.deeplearning4j.nn.graph.ComputationGraph defaultNet,
long seed,
int numLabels,
boolean filterMode)
Initialize the zoo model with the supplied params.
|
boolean |
isPretrained() |
boolean |
isRequiresPooling() |
java.util.Enumeration<weka.core.Option> |
listOptions()
Returns an enumeration describing the available options.
|
boolean |
requiresPreProcessing()
Does the model require input images to be preprocessed?.
|
void |
setChannelsLast(boolean channelsLast) |
void |
setExtraLayersToRemove(java.lang.String[] m_extraLayersToRemove) |
void |
setFeatureExtractionLayer(java.lang.String m_featureExtractionLayer) |
void |
setNumFExtractOutputs(int m_numFExtractOutputs) |
void |
setOptions(java.lang.String[] options)
Parses a given list of options.
|
void |
setOutputLayer(java.lang.String m_outputLayer) |
void |
setPretrainedType(PretrainedType pretrainedType) |
void |
setRequiresPooling(boolean requiresPooling) |
public abstract org.deeplearning4j.nn.graph.ComputationGraph init(int numLabels, long seed, int[] shape, boolean filterMode) throws java.lang.UnsupportedOperationException
numLabels
- Number of labels to adjust the outputseed
- Seedshape
- shapefilterMode
- True if creating for feature extractionjava.lang.UnsupportedOperationException
- Init(...) was not supported (only CustomNet)public org.deeplearning4j.nn.graph.ComputationGraph getDefaultGraph()
public abstract int[] getInputShape()
public java.lang.String getPrettyName()
public abstract java.lang.Enum getVariation()
public boolean requiresPreProcessing()
public abstract org.nd4j.linalg.dataset.api.preprocessor.ImagePreProcessingScaler getImagePreprocessingScaler()
@OptionMetadata(displayName="Image channels last", description="Set to true to supply image channels last. The default value will usually be correct, so as an end user you shouldn\'t need to change this setting. If you do be aware that it may break the model.", commandLineParamName="channelsLast", commandLineParamSynopsis="-channelsLast <boolean>") public boolean getChannelsLast()
public void setChannelsLast(boolean channelsLast)
@ProgrammaticProperty public boolean isRequiresPooling()
public void setRequiresPooling(boolean requiresPooling)
public org.deeplearning4j.nn.graph.ComputationGraph initZooModel(org.deeplearning4j.zoo.ZooModel zooModel, org.deeplearning4j.nn.graph.ComputationGraph defaultNet, long seed, int numLabels, boolean filterMode)
zooModel
- Zoo model family to usedefaultNet
- Default ComputationGraph to use if loading weights failsseed
- Random seed to initialize withnumLabels
- Number of output labelsfilterMode
- True if using this zoo model for a filter - output layers don't need to be setuppublic boolean isPretrained()
@OptionMetadata(description="Pretrained Type (IMAGENET, VGGFACE, MNIST)", displayName="Pretrained Type", commandLineParamName="pretrained", commandLineParamSynopsis="-pretrained <string>") public PretrainedType getPretrainedType()
public void setPretrainedType(PretrainedType pretrainedType)
@ProgrammaticProperty public java.lang.String getOutputlayer()
public void setOutputLayer(java.lang.String m_outputLayer)
@ProgrammaticProperty public java.lang.String getFeatureExtractionLayer()
public void setFeatureExtractionLayer(java.lang.String m_featureExtractionLayer)
@ProgrammaticProperty public java.lang.String[] getExtraLayersToRemove()
public void setExtraLayersToRemove(java.lang.String[] m_extraLayersToRemove)
@ProgrammaticProperty public int getNumFExtractOutputs()
public void setNumFExtractOutputs(int m_numFExtractOutputs)
public java.util.Enumeration<weka.core.Option> listOptions()
listOptions
in interface weka.core.OptionHandler
public java.lang.String[] getOptions()
getOptions
in interface weka.core.OptionHandler
public void setOptions(java.lang.String[] options) throws java.lang.Exception
setOptions
in interface weka.core.OptionHandler
options
- the list of options as an array of stringsjava.lang.Exception
- if an option is not supported