Exemple #1
0
        public void Load(CMNN nn, int index)
        {
            if (H1Dim > 0)
            {
                W0 = nn.CreateMatrix(H1Dim, XDim, "encoder" + index + "_w0", nn.Folder + "/encoder" + index + "_w0" + ".bin");
                b0 = nn.CreateMatrix(H1Dim, 1, "encoder" + index + "_b0", nn.Folder + "/encoder" + index + "_b0" + ".bin");
                W1 = nn.CreateMatrix(H2Dim, H1Dim, "encoder" + index + "_w1", nn.Folder + "/encoder" + index + "_w1" + ".bin");
                b1 = nn.CreateMatrix(H2Dim, 1, "encoder" + index + "_b1", nn.Folder + "/encoder" + index + "_b1" + ".bin");
            }

            X = nn.CreateMatrix(XDim, 1, "encoder" + index + "X");
            Y = nn.CreateMatrix(H2Dim, 1, "encoder" + index + "Y");
        }
Exemple #2
0
 public void Load(CMNN nn, int index)
 {
     Experts = new List <Matrix[]>();
     for (int i = 0; i < 6; i++)
     {
         Experts.Add(new Matrix[GetExperts(nn, index)]);
     }
     for (int i = 0; i < GetExperts(nn, index); i++)
     {
         Experts[0][i] = nn.CreateMatrix(H1Dim, XDim, "wc" + index + "0" + i.ToString("D1") + "_w", nn.Folder + "/wc" + index + "0" + i.ToString("D1") + "_w.bin");
         Experts[1][i] = nn.CreateMatrix(H1Dim, 1, "wc" + index + "0" + i.ToString("D1") + "_b", nn.Folder + "/wc" + index + "0" + i.ToString("D1") + "_b.bin");
         Experts[2][i] = nn.CreateMatrix(H2Dim, H1Dim, "wc" + index + "1" + i.ToString("D1") + "_w", nn.Folder + "/wc" + index + "1" + i.ToString("D1") + "_w.bin");
         Experts[3][i] = nn.CreateMatrix(H2Dim, 1, "wc" + index + "1" + i.ToString("D1") + "_b", nn.Folder + "/wc" + index + "1" + i.ToString("D1") + "_b.bin");
         Experts[4][i] = nn.CreateMatrix(YDim, H2Dim, "wc" + index + "2" + i.ToString("D1") + "_w", nn.Folder + "/wc" + index + "2" + i.ToString("D1") + "_w.bin");
         Experts[5][i] = nn.CreateMatrix(YDim, 1, "wc" + index + "2" + i.ToString("D1") + "_b", nn.Folder + "/wc" + index + "2" + i.ToString("D1") + "_b.bin");
     }
     W0 = nn.CreateMatrix(H1Dim, XDim, "C" + index + "W0");
     b0 = nn.CreateMatrix(H1Dim, 1, "C" + index + "b0");
     W1 = nn.CreateMatrix(H2Dim, H1Dim, "C" + index + "W1");
     b1 = nn.CreateMatrix(H2Dim, 1, "C" + index + "b1");
     W2 = nn.CreateMatrix(YDim, H2Dim, "C" + index + "W2");
     b2 = nn.CreateMatrix(YDim, 1, "C" + index + "b2");
     X  = nn.CreateMatrix(XDim, 1, "C" + index + "X");
     Y  = nn.CreateMatrix(YDim, 1, "C" + index + "Y");
 }