関数ML_x2y マニュアル

(The documentation of function ML_x2y)

Last Update: 2025/8/7


◆機能・用途(Purpose)

1つの層での変数\(X_i^{(m)}\)の値を与えて その線形結合\(Y_j^{(m)}\)の値を計算する。 特定の1つの\(m\)において、全ての\(j\)について計算を行う。
Calculate the values of linear combinations \(Y_j^{(m)}\) given the values of variables \(X_i^{(m)}\) in a layer. The calculation is conducted for a single \(m\) and for all \(j\).


◆形式(Format)

#include <machine_learning/cross_entropy.h>
inline double ∗ML_x2y
(const int J,const int Jnext,const double ∗X, double ∗const ∗W)


◆引数(Arguments)

J 現在の層における変数の数\(J^{(m)}\)。
The number of variables \(J^{(m)}\) in the current layer.
Jnext 次の層における変数の数\(J^{(m+1)}\)。
The number of variables \(J^{(m+1)}\) in the next layer.
X 現在の層における変数の値のリストX[i]\(=X_i^{(m)}\)。 要素数\(J^{(m)}\)の配列として与える。
List of values of variables X[i]\(=X_i^{(m)}\) in the current layer, given as an array of \(J^{(m)}\) components.
W 線形結合の係数W[j][i]\(=W_{j,i}^{(m)}\)。 \(J^{(m+1)}\times [J^{(m)}+1]\) の2次元配列として与える。
The coefficients W[j][i]\(=W_{j,i}^{(m)}\) of the linear combination, given as a 2D array of \(J^{(m+1)}\times [J^{(m)}+1]\) components.


◆戻り値(Return value)

計算した線形結合\(Y_j^{(m)}\)の値のリスト。 要素数\(J^{(m+1)}\)の配列として返す。 \(m\)番目の層を考えた場合、戻り値の配列の第\(j\)要素が \(Y_j^{(m)}\)に対応する。
List of the values of linear combinations \(Y_j^{(m)}\) given as an array of \(J^{(m+1)}\) components. When the \(m\)-th layer is considered, the \(j\)-th component of the array of the return value corresponds to \(Y_j^{(m)}\).


◆使用例(Example)

int J=5;
int Jnext=3;
double X[]={1.2,3.4,5.6,7.8,9.0};
double W[][J]
  ={{1.1,2.2,3.3,4.4,5.5,6.6},
     {-2.3,-3.4,-4.5,-5.6,-6.7,-7.8},
     {4.2,5.3,6.4,7.5,8.6,9.7}};
double Y=ML_x2y(J,Jnext,X,W);


◆計算式(Formula)

計算式2 の(2)式が用いられる。
Eq. (2) of Formulas 2 are used.