create_dl_layer_batch_normalization T_create_dl_layer_batch_normalization CreateDlLayerBatchNormalization CreateDlLayerBatchNormalization create_dl_layer_batch_normalization (Operator)
Name
create_dl_layer_batch_normalization T_create_dl_layer_batch_normalization CreateDlLayerBatchNormalization CreateDlLayerBatchNormalization create_dl_layer_batch_normalization — Erstellen eines Batch-Normalization-Layers.
Signatur
void CreateDlLayerBatchNormalization (const HTuple& DLLayerInput , const HTuple& LayerName , const HTuple& Momentum , const HTuple& Epsilon , const HTuple& Activation , const HTuple& GenParamName , const HTuple& GenParamValue , HTuple* DLLayerBatchNorm )
HDlLayer HDlLayer ::CreateDlLayerBatchNormalization (const HString& LayerName , const HTuple& Momentum , double Epsilon , const HString& Activation , const HTuple& GenParamName , const HTuple& GenParamValue ) const
HDlLayer HDlLayer ::CreateDlLayerBatchNormalization (const HString& LayerName , const HString& Momentum , double Epsilon , const HString& Activation , const HString& GenParamName , const HString& GenParamValue ) const
HDlLayer HDlLayer ::CreateDlLayerBatchNormalization (const char* LayerName , const char* Momentum , double Epsilon , const char* Activation , const char* GenParamName , const char* GenParamValue ) const
HDlLayer HDlLayer ::CreateDlLayerBatchNormalization (const wchar_t* LayerName , const wchar_t* Momentum , double Epsilon , const wchar_t* Activation , const wchar_t* GenParamName , const wchar_t* GenParamValue ) const
(Nur Windows)
static void HOperatorSet .CreateDlLayerBatchNormalization (HTuple DLLayerInput , HTuple layerName , HTuple momentum , HTuple epsilon , HTuple activation , HTuple genParamName , HTuple genParamValue , out HTuple DLLayerBatchNorm )
HDlLayer HDlLayer .CreateDlLayerBatchNormalization (string layerName , HTuple momentum , double epsilon , string activation , HTuple genParamName , HTuple genParamValue )
HDlLayer HDlLayer .CreateDlLayerBatchNormalization (string layerName , string momentum , double epsilon , string activation , string genParamName , string genParamValue )
Beschreibung
Der Operator create_dl_layer_batch_normalization create_dl_layer_batch_normalization CreateDlLayerBatchNormalization CreateDlLayerBatchNormalization CreateDlLayerBatchNormalization create_dl_layer_batch_normalization erzeugt einen
Batch-Normalization-Layer, dessen Handle in DLLayerBatchNorm DLLayerBatchNorm DLLayerBatchNorm DLLayerBatchNorm DLLayerBatchNorm dllayer_batch_norm
zurückgegeben wird.
Die Batch-Normalisierung wird verwendet, um die Leistung und Stabilität eines
Neuronalen Netzwerks während des Trainings zu verbessern.
Der Mittelwert und die Varianz jeder Eingabeaktivierung werden für jeden
Batch berechnet und die Eingabewerte werden so transformiert, dass sie
einen Mittelwert und eine Einheitsvarianz von Null haben.
Außerdem wird eine lineare Skalierungs- und Verschiebungstransformation
gelernt. Um alle Samples zu berücksichtigen werden während des Trainings
der gleitende Mittelwert und die gleitende Varianz ermittelt.
Dies geschieht, indem die pro Batch ermittelten Mittelwerte und Varianzwerte
mit einem Momentum Momentum Momentum Momentum momentum momentum kombiniert werden:
wobei
den Iterationsindex bezeichnet.
Um Mittelwert und Varianz zu beeinflussen, können die folgenden Optionen
für Momentum Momentum Momentum Momentum momentum momentum gesetzt werden:
Zahl:
Beispielsweise 0.9 . Dies ist die empfohlene Option.
Restriktion: 0
Momentum Momentum Momentum Momentum momentum momentum
1
'auto' "auto" "auto" "auto" "auto" "auto" :
Kombiniert Mittelwerte und Varianzwerte durch einen
kumulativen gleitenden Durchschnitt. Diese Option sollte nur verwendet werden,
wenn die Parameter der vorherigen Layer im Netzwerk konstant bleiben, d.h.,
eine Lernrate von 0 haben.
'freeze' "freeze" "freeze" "freeze" "freeze" "freeze" :
Stoppt die Anpassung von Mittelwert und
Varianz, wodurch ihre Werte fest bleiben. Der Mittelwert und die Varianz
werden in diesem Fall während des Trainings verwendet, um einen Batch
zu normalisieren, analog zum Modus der Batch-Normalisierung während der
Inferenz. Die Parameter der linearen Skalierungs- und
Verschiebungstransformation bleiben jedoch lernbar.
Epsilon Epsilon Epsilon Epsilon epsilon epsilon ist ein kleiner Offset zur Varianz, der zur Kontrolle
der numerischen Stabilität verwendet wird.
Normalerweise sollte sein Standardwert angemessen sein.
Der Parameter DLLayerInput DLLayerInput DLLayerInput DLLayerInput DLLayerInput dllayer_input bestimmt den zuführenden Eingabelayer
und erwartet das Layer-Handle als Wert.
Der Parameter LayerName LayerName LayerName LayerName layerName layer_name legt einen individuellen Layernamen fest.
Es ist zu beachten, dass beim Erstellen eines Modells mit
create_dl_model create_dl_model CreateDlModel CreateDlModel CreateDlModel create_dl_model jeder Layer des erstellten Netzes einen
eindeutigen Namen haben muss.
Der Parameter Activation Activation Activation Activation activation activation bestimmt, ob eine Aktivierung
nach der Batch-Normalisierung durchgeführt wird, um die Laufzeit
optimieren.
Die folgenden generischen Parameter GenParamName GenParamName GenParamName GenParamName genParamName gen_param_name und die
entsprechenden Werte GenParamValue GenParamValue GenParamValue GenParamValue genParamValue gen_param_value werden unterstützt:
'bias_filler' "bias_filler" "bias_filler" "bias_filler" "bias_filler" "bias_filler" :
Siehe create_dl_layer_convolution create_dl_layer_convolution CreateDlLayerConvolution CreateDlLayerConvolution CreateDlLayerConvolution create_dl_layer_convolution für eine detaillierte
Erläuterung dieses Parameters und seiner Werte.
Werteliste: 'xavier' "xavier" "xavier" "xavier" "xavier" "xavier" , 'msra' "msra" "msra" "msra" "msra" "msra" ,
'const' "const" "const" "const" "const" "const" .
Default: 'const' "const" "const" "const" "const" "const"
'bias_filler_const_val' "bias_filler_const_val" "bias_filler_const_val" "bias_filler_const_val" "bias_filler_const_val" "bias_filler_const_val" :
Konstanter Wert.
Restriktion: 'bias_filler' "bias_filler" "bias_filler" "bias_filler" "bias_filler" "bias_filler" muss hierfür auf
'const' "const" "const" "const" "const" "const" gesetzt sein.
Default: 0
'bias_filler_variance_norm' "bias_filler_variance_norm" "bias_filler_variance_norm" "bias_filler_variance_norm" "bias_filler_variance_norm" "bias_filler_variance_norm" :
Siehe create_dl_layer_convolution create_dl_layer_convolution CreateDlLayerConvolution CreateDlLayerConvolution CreateDlLayerConvolution create_dl_layer_convolution für eine detaillierte
Erläuterung dieses Parameters und seiner Werte.
Werteliste: 'norm_out' "norm_out" "norm_out" "norm_out" "norm_out" "norm_out" , 'norm_in' "norm_in" "norm_in" "norm_in" "norm_in" "norm_in" ,
'norm_average' "norm_average" "norm_average" "norm_average" "norm_average" "norm_average" oder konstanter Wert (falls
'bias_filler' "bias_filler" "bias_filler" "bias_filler" "bias_filler" "bias_filler" = 'msra' "msra" "msra" "msra" "msra" "msra" ).
Default: 'norm_out' "norm_out" "norm_out" "norm_out" "norm_out" "norm_out"
'bias_term' "bias_term" "bias_term" "bias_term" "bias_term" "bias_term" :
Bestimmt, ob der erstellte
Batch-Normalization-Layer einen Bias-Term hat ('true' "true" "true" "true" "true" "true" ) oder nicht
('false' "false" "false" "false" "false" "false" ).
Default: 'true' "true" "true" "true" "true" "true"
'is_inference_output' "is_inference_output" "is_inference_output" "is_inference_output" "is_inference_output" "is_inference_output" :
Bestimmt, ob apply_dl_model apply_dl_model ApplyDlModel ApplyDlModel ApplyDlModel apply_dl_model die Ausgabe dieses Layers im
Dictionary DLResultBatch DLResultBatch DLResultBatch DLResultBatch DLResultBatch dlresult_batch zurückgibt, auch ohne den
Layer in Outputs Outputs Outputs Outputs outputs outputs anzugeben ('true' "true" "true" "true" "true" "true" ), oder
nur falls er angegeben wird ('false' "false" "false" "false" "false" "false" ).
Default: 'false' "false" "false" "false" "false" "false"
'learning_rate_multiplier' "learning_rate_multiplier" "learning_rate_multiplier" "learning_rate_multiplier" "learning_rate_multiplier" "learning_rate_multiplier" :
Multiplikator für die Lernrate
für diesen Layer, die beim Training verwendet wird.
Wenn 'learning_rate_multiplier' "learning_rate_multiplier" "learning_rate_multiplier" "learning_rate_multiplier" "learning_rate_multiplier" "learning_rate_multiplier" auf 0.0 gesetzt ist,
wird der Layer beim Training übersprungen.
Default: 1.0
'learning_rate_multiplier_bias' "learning_rate_multiplier_bias" "learning_rate_multiplier_bias" "learning_rate_multiplier_bias" "learning_rate_multiplier_bias" "learning_rate_multiplier_bias" :
Multiplikator für die
Lernrate des Bias-Terms. Die gesamte Bias-Lernrate ist das
Produkt aus 'learning_rate_multiplier_bias' "learning_rate_multiplier_bias" "learning_rate_multiplier_bias" "learning_rate_multiplier_bias" "learning_rate_multiplier_bias" "learning_rate_multiplier_bias" und
'learning_rate_multiplier' "learning_rate_multiplier" "learning_rate_multiplier" "learning_rate_multiplier" "learning_rate_multiplier" "learning_rate_multiplier" .
Default: 1.0
'upper_bound' "upper_bound" "upper_bound" "upper_bound" "upper_bound" "upper_bound" :
Fließkommawert, der die obere Grenze
für die ReLU definiert. Um die obere Grenze aufzuheben, kann
'upper_bound' "upper_bound" "upper_bound" "upper_bound" "upper_bound" "upper_bound" auf ein leeres Tupel gesetzt werden.
Default: []
'weight_filler' "weight_filler" "weight_filler" "weight_filler" "weight_filler" "weight_filler" :
Siehe create_dl_layer_convolution create_dl_layer_convolution CreateDlLayerConvolution CreateDlLayerConvolution CreateDlLayerConvolution create_dl_layer_convolution für eine detaillierte
Erläuterung dieses Parameters und seiner Werte.
Werteliste: 'xavier' "xavier" "xavier" "xavier" "xavier" "xavier" , 'msra' "msra" "msra" "msra" "msra" "msra" ,
'const' "const" "const" "const" "const" "const" .
Default: 'const' "const" "const" "const" "const" "const"
'weight_filler_const_val' "weight_filler_const_val" "weight_filler_const_val" "weight_filler_const_val" "weight_filler_const_val" "weight_filler_const_val" :
Siehe create_dl_layer_convolution create_dl_layer_convolution CreateDlLayerConvolution CreateDlLayerConvolution CreateDlLayerConvolution create_dl_layer_convolution für eine detaillierte
Erläuterung dieses Parameters und seiner Werte.
Default: 1.0
'weight_filler_variance_norm' "weight_filler_variance_norm" "weight_filler_variance_norm" "weight_filler_variance_norm" "weight_filler_variance_norm" "weight_filler_variance_norm" :
Siehe create_dl_layer_convolution create_dl_layer_convolution CreateDlLayerConvolution CreateDlLayerConvolution CreateDlLayerConvolution create_dl_layer_convolution für eine detaillierte
Erläuterung dieses Parameters und seiner Werte.
Werteliste: 'norm_in' "norm_in" "norm_in" "norm_in" "norm_in" "norm_in" , 'norm_out' "norm_out" "norm_out" "norm_out" "norm_out" "norm_out" ,
'norm_average' "norm_average" "norm_average" "norm_average" "norm_average" "norm_average" oder konstanter Wert (falls
'weight_filler' "weight_filler" "weight_filler" "weight_filler" "weight_filler" "weight_filler" = 'msra' "msra" "msra" "msra" "msra" "msra" ).
Default: 'norm_in' "norm_in" "norm_in" "norm_in" "norm_in" "norm_in"
Bestimmte Parameter von Layern, die mit
create_dl_layer_batch_normalization create_dl_layer_batch_normalization CreateDlLayerBatchNormalization CreateDlLayerBatchNormalization CreateDlLayerBatchNormalization create_dl_layer_batch_normalization
erzeugt wurden, können mit weiteren Operatoren gesetzt und abgerufen werden.
Die folgenden Tabellen geben einen Überblick, welche Parameter mit
set_dl_model_layer_param set_dl_model_layer_param SetDlModelLayerParam SetDlModelLayerParam SetDlModelLayerParam set_dl_model_layer_param gesetzt werden können und welche mit
get_dl_model_layer_param get_dl_model_layer_param GetDlModelLayerParam GetDlModelLayerParam GetDlModelLayerParam get_dl_model_layer_param oder get_dl_layer_param get_dl_layer_param GetDlLayerParam GetDlLayerParam GetDlLayerParam get_dl_layer_param ausgelesen
werden können. Es ist zu beachten, dass die Operatoren
set_dl_model_layer_param set_dl_model_layer_param SetDlModelLayerParam SetDlModelLayerParam SetDlModelLayerParam set_dl_model_layer_param und get_dl_model_layer_param get_dl_model_layer_param GetDlModelLayerParam GetDlModelLayerParam GetDlModelLayerParam get_dl_model_layer_param ein
Modell benötigen, das mit create_dl_model create_dl_model CreateDlModel CreateDlModel CreateDlModel create_dl_model erzeugt wurde.
Generische Layer-Parameter
set
get
'bias_filler' "bias_filler" "bias_filler" "bias_filler" "bias_filler" "bias_filler"
'bias_filler_const_val' "bias_filler_const_val" "bias_filler_const_val" "bias_filler_const_val" "bias_filler_const_val" "bias_filler_const_val"
'bias_filler_variance_norm' "bias_filler_variance_norm" "bias_filler_variance_norm" "bias_filler_variance_norm" "bias_filler_variance_norm" "bias_filler_variance_norm"
'bias_term' "bias_term" "bias_term" "bias_term" "bias_term" "bias_term"
'is_inference_output' "is_inference_output" "is_inference_output" "is_inference_output" "is_inference_output" "is_inference_output"
'learning_rate_multiplier' "learning_rate_multiplier" "learning_rate_multiplier" "learning_rate_multiplier" "learning_rate_multiplier" "learning_rate_multiplier"
'learning_rate_multiplier_bias' "learning_rate_multiplier_bias" "learning_rate_multiplier_bias" "learning_rate_multiplier_bias" "learning_rate_multiplier_bias" "learning_rate_multiplier_bias"
'num_trainable_params' "num_trainable_params" "num_trainable_params" "num_trainable_params" "num_trainable_params" "num_trainable_params"
'upper_bound' "upper_bound" "upper_bound" "upper_bound" "upper_bound" "upper_bound"
'weight_filler' "weight_filler" "weight_filler" "weight_filler" "weight_filler" "weight_filler"
'weight_filler_const_val' "weight_filler_const_val" "weight_filler_const_val" "weight_filler_const_val" "weight_filler_const_val" "weight_filler_const_val"
'weight_filler_variance_norm' "weight_filler_variance_norm" "weight_filler_variance_norm" "weight_filler_variance_norm" "weight_filler_variance_norm" "weight_filler_variance_norm"
Ausführungsinformationen
Multithreading-Typ: reentrant (läuft parallel zu nicht-exklusiven Operatoren).
Multithreading-Bereich: global (kann von jedem Thread aufgerufen werden).
Wird ohne Parallelisierung verarbeitet.
Parameter
DLLayerInput DLLayerInput DLLayerInput DLLayerInput DLLayerInput dllayer_input (input_control) dl_layer → HDlLayer , HTuple HHandle HTuple Htuple (handle) (IntPtr ) (HHandle ) (handle )
Zuführender Layer.
LayerName LayerName LayerName LayerName layerName layer_name (input_control) string → HTuple str HTuple Htuple (string) (string ) (HString ) (char* )
Name des Ausgabelayers.
Momentum Momentum Momentum Momentum momentum momentum (input_control) string → HTuple Union[float, str] HTuple Htuple (string / real) (string / double) (HString / double) (char* / double)
Momentum.
Defaultwert: 0.9
Werteliste: 0.9, 0.99, 0.999, 'auto' "auto" "auto" "auto" "auto" "auto" , 'freeze' "freeze" "freeze" "freeze" "freeze" "freeze"
Epsilon Epsilon Epsilon Epsilon epsilon epsilon (input_control) number → HTuple float HTuple Htuple (real) (double ) (double ) (double )
Offset zur Varianz.
Defaultwert: 0.0001
Activation Activation Activation Activation activation activation (input_control) string → HTuple str HTuple Htuple (string) (string ) (HString ) (char* )
Optionale Aktivierungsfunktion.
Defaultwert:
'none'
"none"
"none"
"none"
"none"
"none"
Werteliste: 'none' "none" "none" "none" "none" "none" , 'relu' "relu" "relu" "relu" "relu" "relu"
GenParamName GenParamName GenParamName GenParamName genParamName gen_param_name (input_control) attribute.name(-array) → HTuple MaybeSequence[str] HTuple Htuple (string) (string ) (HString ) (char* )
Namen der generischen Eingabeparameter.
Defaultwert: []
Werteliste: 'bias_filler' "bias_filler" "bias_filler" "bias_filler" "bias_filler" "bias_filler" , 'bias_filler_const_val' "bias_filler_const_val" "bias_filler_const_val" "bias_filler_const_val" "bias_filler_const_val" "bias_filler_const_val" , 'bias_filler_variance_norm' "bias_filler_variance_norm" "bias_filler_variance_norm" "bias_filler_variance_norm" "bias_filler_variance_norm" "bias_filler_variance_norm" , 'bias_term' "bias_term" "bias_term" "bias_term" "bias_term" "bias_term" , 'is_inference_output' "is_inference_output" "is_inference_output" "is_inference_output" "is_inference_output" "is_inference_output" , 'learning_rate_multiplier' "learning_rate_multiplier" "learning_rate_multiplier" "learning_rate_multiplier" "learning_rate_multiplier" "learning_rate_multiplier" , 'learning_rate_multiplier_bias' "learning_rate_multiplier_bias" "learning_rate_multiplier_bias" "learning_rate_multiplier_bias" "learning_rate_multiplier_bias" "learning_rate_multiplier_bias" , 'upper_bound' "upper_bound" "upper_bound" "upper_bound" "upper_bound" "upper_bound" , 'weight_filler' "weight_filler" "weight_filler" "weight_filler" "weight_filler" "weight_filler" , 'weight_filler_const_val' "weight_filler_const_val" "weight_filler_const_val" "weight_filler_const_val" "weight_filler_const_val" "weight_filler_const_val" , 'weight_filler_variance_norm' "weight_filler_variance_norm" "weight_filler_variance_norm" "weight_filler_variance_norm" "weight_filler_variance_norm" "weight_filler_variance_norm"
GenParamValue GenParamValue GenParamValue GenParamValue genParamValue gen_param_value (input_control) attribute.value(-array) → HTuple MaybeSequence[Union[int, float, str]] HTuple Htuple (string / integer / real) (string / int / long / double) (HString / Hlong / double) (char* / Hlong / double)
Werte der generischen Eingabeparameter.
Defaultwert: []
Wertevorschläge: 'xavier' "xavier" "xavier" "xavier" "xavier" "xavier" , 'msra' "msra" "msra" "msra" "msra" "msra" , 'const' "const" "const" "const" "const" "const" , 'nearest_neighbor' "nearest_neighbor" "nearest_neighbor" "nearest_neighbor" "nearest_neighbor" "nearest_neighbor" , 'bilinear' "bilinear" "bilinear" "bilinear" "bilinear" "bilinear" , 'norm_in' "norm_in" "norm_in" "norm_in" "norm_in" "norm_in" , 'norm_out' "norm_out" "norm_out" "norm_out" "norm_out" "norm_out" , 'norm_average' "norm_average" "norm_average" "norm_average" "norm_average" "norm_average" , 'true' "true" "true" "true" "true" "true" , 'false' "false" "false" "false" "false" "false" , 1.0, 0.9, 0.0
DLLayerBatchNorm DLLayerBatchNorm DLLayerBatchNorm DLLayerBatchNorm DLLayerBatchNorm dllayer_batch_norm (output_control) dl_layer → HDlLayer , HTuple HHandle HTuple Htuple (handle) (IntPtr ) (HHandle ) (handle )
Batch-Normalization-Layer.
Beispiel (HDevelop)
create_dl_layer_input ('input', [224,224,3], [], [], DLLayerInput)
* In practice, one typically sets ['bias_term'], ['false'] for a convolution
* that is directly followed by a batch normalization layer.
create_dl_layer_convolution (DLLayerInput, 'conv1', 3, 1, 1, 64, 1, \
'none', 'none', ['bias_term'], ['false'], \
DLLayerConvolution)
create_dl_layer_batch_normalization (DLLayerConvolution, 'bn1', 0.9, \
0.0001, 'none', [], [], \
DLLayerBatchNorm)
Vorgänger
create_dl_layer_convolution create_dl_layer_convolution CreateDlLayerConvolution CreateDlLayerConvolution CreateDlLayerConvolution create_dl_layer_convolution
Nachfolger
create_dl_layer_activation create_dl_layer_activation CreateDlLayerActivation CreateDlLayerActivation CreateDlLayerActivation create_dl_layer_activation ,
create_dl_layer_convolution create_dl_layer_convolution CreateDlLayerConvolution CreateDlLayerConvolution CreateDlLayerConvolution create_dl_layer_convolution
Literatur
Sergey Ioffe and Christian Szegedy,
"Batch Normalization: Accelerating Deep Network Training by Reducing Internal
Covariate Shift,"
Proceedings of the 32nd International Conference on Machine Learning,
(ICML) 2015, Lille, France, 6-11 July 2015, pp. 448--456
Modul
Deep Learning Training