🤖 AIによる機械翻訳(非公式) — これは OpenCV 5.0.0 公式リファレンス(英語)を AI (Claude) で自動翻訳したものです。訳に誤りを含む場合があります。正確な情報は 公式英語版(原文) を参照してください。
Package org.opencv.ml
クラス ANN_MLP
- java.lang.Object
-
- org.opencv.core.Algorithm
-
- org.opencv.ml.StatModel
-
- org.opencv.ml.ANN_MLP
public class ANN_MLP extends StatModel
ニューラルネットワーク - 多層パーセプトロン (Multi-Layer Perceptrons)。生成と学習が一度に行われるMLの他の多くのモデルとは異なり、MLPモデルではこれらの段階が分離されている。まず、指定したトポロジを持つネットワークを、非デフォルトのコンストラクタまたはメソッド ANN_MLP::create を使って生成する。すべての重みはゼロに設定される。次に、入力ベクトルと出力ベクトルの集合を使ってネットワークを学習させる。学習手続きは複数回繰り返すことができる。すなわち、新しい学習データに基づいて重みを調整できる。StatModel::train に対しては追加のフラグ ANN_MLP::TrainFlags が利用できる。SEE: REF: ml_intro_ann
-
-
フィールドの要約
フィールド Modifier and Type Field Description static intANNEALstatic intBACKPROPstatic intGAUSSIANstatic intIDENTITYstatic intLEAKYRELUstatic intNO_INPUT_SCALEstatic intNO_OUTPUT_SCALEstatic intRELUstatic intRPROPstatic intSIGMOID_SYMstatic intUPDATE_WEIGHTS-
クラス org.opencv.ml.StatModel から継承されたフィールド
COMPRESSED_INPUT, PREPROCESSED_INPUT, RAW_OUTPUT, UPDATE_MODEL
-
-
コンストラクタの要約
コンストラクタ Modifier Constructor Description protectedANN_MLP​(long addr)
-
メソッドの要約
すべてのメソッド 静的メソッド インスタンスメソッド 具象メソッド Modifier and Type Method Description static ANN_MLP__fromPtr__​(long addr)static ANN_MLPcreate()Creates empty model Use StatModel::train to train the model, Algorithm::load<ANN_MLP>(filename) to load the pre-trained model.doublegetAnnealCoolingRatio()SEE: setAnnealCoolingRatiodoublegetAnnealFinalT()SEE: setAnnealFinalTdoublegetAnnealInitialT()SEE: setAnnealInitialTintgetAnnealItePerStep()SEE: setAnnealItePerStepdoublegetBackpropMomentumScale()SEE: setBackpropMomentumScaledoublegetBackpropWeightScale()SEE: setBackpropWeightScaleMatgetLayerSizes()Integer vector specifying the number of neurons in each layer including the input and output layers.doublegetRpropDW0()SEE: setRpropDW0doublegetRpropDWMax()SEE: setRpropDWMaxdoublegetRpropDWMin()SEE: setRpropDWMindoublegetRpropDWMinus()SEE: setRpropDWMinusdoublegetRpropDWPlus()SEE: setRpropDWPlusTermCriteriagetTermCriteria()SEE: setTermCriteriaintgetTrainMethod()Returns current training methodMatgetWeights​(int layerIdx)static ANN_MLPload​(java.lang.String filepath)Loads and creates a serialized ANN from a file Use ANN::save to serialize and store an ANN to disk.voidsetActivationFunction​(int type)Initialize the activation function for each neuron.voidsetActivationFunction​(int type, double param1)Initialize the activation function for each neuron.voidsetActivationFunction​(int type, double param1, double param2)Initialize the activation function for each neuron.voidsetAnnealCoolingRatio​(double val)getAnnealCoolingRatio SEE: getAnnealCoolingRatiovoidsetAnnealFinalT​(double val)getAnnealFinalT SEE: getAnnealFinalTvoidsetAnnealInitialT​(double val)getAnnealInitialT SEE: getAnnealInitialTvoidsetAnnealItePerStep​(int val)getAnnealItePerStep SEE: getAnnealItePerStepvoidsetBackpropMomentumScale​(double val)getBackpropMomentumScale SEE: getBackpropMomentumScalevoidsetBackpropWeightScale​(double val)getBackpropWeightScale SEE: getBackpropWeightScalevoidsetLayerSizes​(Mat _layer_sizes)Integer vector specifying the number of neurons in each layer including the input and output layers.voidsetRpropDW0​(double val)getRpropDW0 SEE: getRpropDW0voidsetRpropDWMax​(double val)getRpropDWMax SEE: getRpropDWMaxvoidsetRpropDWMin​(double val)getRpropDWMin SEE: getRpropDWMinvoidsetRpropDWMinus​(double val)getRpropDWMinus SEE: getRpropDWMinusvoidsetRpropDWPlus​(double val)getRpropDWPlus SEE: getRpropDWPlusvoidsetTermCriteria​(TermCriteria val)getTermCriteria SEE: getTermCriteriavoidsetTrainMethod​(int method)Sets training method and common parameters.voidsetTrainMethod​(int method, double param1)Sets training method and common parameters.voidsetTrainMethod​(int method, double param1, double param2)Sets training method and common parameters.-
クラス org.opencv.ml.StatModel から継承されたメソッド
calcError, empty, getVarCount, isClassifier, isTrained, predict, predict, predict, train, train, train
-
クラス org.opencv.core.Algorithm から継承されたメソッド
clear, getDefaultName, getNativeObjAddr, save
-
-
-
-
フィールドの詳細
-
IDENTITY
public static final int IDENTITY
- 関連項目:
- 定数フィールド値
-
SIGMOID_SYM
public static final int SIGMOID_SYM
- 関連項目:
- 定数フィールド値
-
GAUSSIAN
public static final int GAUSSIAN
- 関連項目:
- 定数フィールド値
-
RELU
public static final int RELU
- 関連項目:
- 定数フィールド値
-
LEAKYRELU
public static final int LEAKYRELU
- 関連項目:
- 定数フィールド値
-
UPDATE_WEIGHTS
public static final int UPDATE_WEIGHTS
- 関連項目:
- 定数フィールド値
-
NO_INPUT_SCALE
public static final int NO_INPUT_SCALE
- 関連項目:
- 定数フィールド値
-
NO_OUTPUT_SCALE
public static final int NO_OUTPUT_SCALE
- 関連項目:
- 定数フィールド値
-
BACKPROP
public static final int BACKPROP
- 関連項目:
- 定数フィールド値
-
RPROP
public static final int RPROP
- 関連項目:
- 定数フィールド値
-
ANNEAL
public static final int ANNEAL
- 関連項目:
- 定数フィールド値
-
-
メソッドの詳細
-
__fromPtr__
public static ANN_MLP __fromPtr__​(long addr)
-
setTrainMethod
public void setTrainMethod​(int method, double param1, double param2)Sets training method and common parameters.- 引数:
method- デフォルト値は ANN_MLP::RPROP。ANN_MLP::TrainingMethods を参照。param1- ANN_MLP::RPROP の場合は setRpropDW0 に、ANN_MLP::BACKPROP の場合は setBackpropWeightScale に、ANN_MLP::ANNEAL の場合は initialT に渡される。param2- ANN_MLP::RPROP の場合は setRpropDWMin に、ANN_MLP::BACKPROP の場合は setBackpropMomentumScale に、ANN_MLP::ANNEAL の場合は finalT に渡される。
-
setTrainMethod
public void setTrainMethod​(int method, double param1)Sets training method and common parameters.- 引数:
method- デフォルト値は ANN_MLP::RPROP。ANN_MLP::TrainingMethods を参照。param1- ANN_MLP::RPROP の場合は setRpropDW0 に、ANN_MLP::BACKPROP の場合は setBackpropWeightScale に、ANN_MLP::ANNEAL の場合は initialT に渡される。
-
setTrainMethod
public void setTrainMethod​(int method)
Sets training method and common parameters.- 引数:
method- デフォルト値は ANN_MLP::RPROP。ANN_MLP::TrainingMethods を参照。
-
getTrainMethod
public int getTrainMethod()
Returns current training method- 戻り値:
- 自動生成
-
setActivationFunction
public void setActivationFunction​(int type, double param1, double param2)Initialize the activation function for each neuron. Currently the default and the only fully supported activation function is ANN_MLP::SIGMOID_SYM.- 引数:
type- 活性化関数の種類。ANN_MLP::ActivationFunctions を参照。param1- 活性化関数の第1引数、\(\alpha\)。デフォルト値は0。param2- 活性化関数の第2引数、\(\beta\)。デフォルト値は0。
-
setActivationFunction
public void setActivationFunction​(int type, double param1)Initialize the activation function for each neuron. Currently the default and the only fully supported activation function is ANN_MLP::SIGMOID_SYM.- 引数:
type- 活性化関数の種類。ANN_MLP::ActivationFunctions を参照。param1- 活性化関数の第1引数、\(\alpha\)。デフォルト値は0。
-
setActivationFunction
public void setActivationFunction​(int type)
Initialize the activation function for each neuron. Currently the default and the only fully supported activation function is ANN_MLP::SIGMOID_SYM.- 引数:
type- 活性化関数の種類。ANN_MLP::ActivationFunctions を参照。
-
setLayerSizes
public void setLayerSizes​(Mat _layer_sizes)
Integer vector specifying the number of neurons in each layer including the input and output layers. The very first element specifies the number of elements in the input layer. The last element - number of elements in the output layer. Default value is empty Mat. SEE: getLayerSizes- 引数:
_layer_sizes- 自動生成
-
getLayerSizes
public Mat getLayerSizes()
Integer vector specifying the number of neurons in each layer including the input and output layers. The very first element specifies the number of elements in the input layer. The last element - number of elements in the output layer. SEE: setLayerSizes- 戻り値:
- 自動生成
-
getTermCriteria
public TermCriteria getTermCriteria()
SEE: setTermCriteria- 戻り値:
- 自動生成
-
setTermCriteria
public void setTermCriteria​(TermCriteria val)
getTermCriteria SEE: getTermCriteria- 引数:
val- 自動生成
-
getBackpropWeightScale
public double getBackpropWeightScale()
SEE: setBackpropWeightScale- 戻り値:
- 自動生成
-
setBackpropWeightScale
public void setBackpropWeightScale​(double val)
getBackpropWeightScale SEE: getBackpropWeightScale- 引数:
val- 自動生成
-
getBackpropMomentumScale
public double getBackpropMomentumScale()
SEE: setBackpropMomentumScale- 戻り値:
- 自動生成
-
setBackpropMomentumScale
public void setBackpropMomentumScale​(double val)
getBackpropMomentumScale SEE: getBackpropMomentumScale- 引数:
val- 自動生成
-
getRpropDW0
public double getRpropDW0()
SEE: setRpropDW0- 戻り値:
- 自動生成
-
setRpropDW0
public void setRpropDW0​(double val)
getRpropDW0 SEE: getRpropDW0- 引数:
val- 自動生成
-
getRpropDWPlus
public double getRpropDWPlus()
SEE: setRpropDWPlus- 戻り値:
- 自動生成
-
setRpropDWPlus
public void setRpropDWPlus​(double val)
getRpropDWPlus SEE: getRpropDWPlus- 引数:
val- 自動生成
-
getRpropDWMinus
public double getRpropDWMinus()
SEE: setRpropDWMinus- 戻り値:
- 自動生成
-
setRpropDWMinus
public void setRpropDWMinus​(double val)
getRpropDWMinus SEE: getRpropDWMinus- 引数:
val- 自動生成
-
getRpropDWMin
public double getRpropDWMin()
SEE: setRpropDWMin- 戻り値:
- 自動生成
-
setRpropDWMin
public void setRpropDWMin​(double val)
getRpropDWMin SEE: getRpropDWMin- 引数:
val- 自動生成
-
getRpropDWMax
public double getRpropDWMax()
SEE: setRpropDWMax- 戻り値:
- 自動生成
-
setRpropDWMax
public void setRpropDWMax​(double val)
getRpropDWMax SEE: getRpropDWMax- 引数:
val- 自動生成
-
getAnnealInitialT
public double getAnnealInitialT()
SEE: setAnnealInitialT- 戻り値:
- 自動生成
-
setAnnealInitialT
public void setAnnealInitialT​(double val)
getAnnealInitialT SEE: getAnnealInitialT- 引数:
val- 自動生成
-
getAnnealFinalT
public double getAnnealFinalT()
SEE: setAnnealFinalT- 戻り値:
- 自動生成
-
setAnnealFinalT
public void setAnnealFinalT​(double val)
getAnnealFinalT SEE: getAnnealFinalT- 引数:
val- 自動生成
-
getAnnealCoolingRatio
public double getAnnealCoolingRatio()
SEE: setAnnealCoolingRatio- 戻り値:
- 自動生成
-
setAnnealCoolingRatio
public void setAnnealCoolingRatio​(double val)
getAnnealCoolingRatio SEE: getAnnealCoolingRatio- 引数:
val- 自動生成
-
getAnnealItePerStep
public int getAnnealItePerStep()
SEE: setAnnealItePerStep- 戻り値:
- 自動生成
-
setAnnealItePerStep
public void setAnnealItePerStep​(int val)
getAnnealItePerStep SEE: getAnnealItePerStep- 引数:
val- 自動生成
-
getWeights
public Mat getWeights​(int layerIdx)
-
create
public static ANN_MLP create()
Creates empty model Use StatModel::train to train the model, Algorithm::load<ANN_MLP>(filename) to load the pre-trained model. Note that the train method has optional flags: ANN_MLP::TrainFlags.- 戻り値:
- 自動生成
-
load
public static ANN_MLP load​(java.lang.String filepath)
Loads and creates a serialized ANN from a file Use ANN::save to serialize and store an ANN to disk. Load the ANN from this file again, by calling this function with the path to the file.- 引数:
filepath- シリアライズされたANNへのパス- 戻り値:
- 自動生成
-
-