autoht_1=INPUT_VARIABLE(1);// previous cell output [bS x numProj], that is at previous time step t-1, in case of projection=false -> numProj=numUnits!!!
autoct_1=INPUT_VARIABLE(2);// previous cell state [bS x numUnits], that is at previous time step t-1
autoWx=INPUT_VARIABLE(3);// input-to-hidden weights, [inSize x 4*numUnits]
autoWh=INPUT_VARIABLE(4);// hidden-to-hidden weights, [numProj x 4*numUnits]
autoWc=INPUT_VARIABLE(5);// diagonal weights for peephole connections [3*numUnits]
autoWp=INPUT_VARIABLE(6);// projection weights [numUnits x numProj]
autob=INPUT_VARIABLE(7);// biases, [4*numUnits]
autoht=OUTPUT_VARIABLE(0);// current cell output [bS x numProj], that is at current time step t
autoct=OUTPUT_VARIABLE(1);// current cell state [bS x numUnits], that is at current time step t
constintpeephole=INT_ARG(0);// if 1, provide peephole connections
constintprojection=INT_ARG(1);// if 1, then projection is performed, if false then numProj==numUnits is mandatory!!!!
// FIXME: double?
constdoubleclippingCellValue=T_ARG(0);// clipping value for ct, if it is not equal to zero, then cell state is clipped
constdoubleclippingProjValue=T_ARG(1);// clipping value for projected ht, if it is not equal to zero, then projected cell output is clipped
REQUIRE_TRUE(correctHt_1Shape==ht_1Shape,0,"LSTMCELL operation: wrong shape of initial cell output, expected is %s, but got %s instead !",correctHt_1Shape.c_str(),ht_1Shape.c_str());
REQUIRE_TRUE(correctCt_1Shape==ct_1Shape,0,"LSTMCELL operation: wrong shape of initial cell state, expected is %s, but got %s instead !",correctCt_1Shape.c_str(),ct_1Shape.c_str());
REQUIRE_TRUE(correctWxShape==WxShape,0,"LSTMCELL operation: wrong shape of input-to-hidden weights, expected is %s, but got %s instead !",correctWxShape.c_str(),WxShape.c_str());
REQUIRE_TRUE(correctWhShape==WhShape,0,"LSTMCELL operation: wrong shape of hidden-to-hidden weights, expected is %s, but got %s instead !",correctWhShape.c_str(),WhShape.c_str());
REQUIRE_TRUE(correctWcShape==WcShape,0,"LSTMCELL operation: wrong shape of diagonal weights for peephole connections, expected is %s, but got %s instead !",correctWcShape.c_str(),WcShape.c_str());
REQUIRE_TRUE(correctWpShape==WpShape,0,"LSTMCELL operation: wrong shape of projection weights, expected is %s, but got %s instead !",correctWpShape.c_str(),WpShape.c_str());
REQUIRE_TRUE(correctBShape==bShape,0,"LSTMCELL operation: wrong shape of biases, expected is %s, but got %s instead !",correctBShape.c_str(),bShape.c_str());
REQUIRE_TRUE(!(!projection&&numUnits!=numProj),0,"LSTMCELL operation: projection option is switched of, and in this case output dimensionality for the projection matrices (numProj) must be equal to number of units in lstmCell !");
autoxtShapeInfo=inputShape->at(0);// input [bS x inSize]
autoht_1ShapeInfo=inputShape->at(1);// previous cell output [bS x numProj], that is at previous time step t-1, in case of projection=false -> numProj=numUnits!!!
autoct_1ShapeInfo=inputShape->at(2);// previous cell state [bS x numUnits], that is at previous time step t-1
autoWxShapeInfo=inputShape->at(3);// input-to-hidden weights, [inSize x 4*numUnits]
autoWhShapeInfo=inputShape->at(4);// hidden-to-hidden weights, [numProj x 4*numUnits]
autoWcShapeInfo=inputShape->at(5);// diagonal weights for peephole connections [3*numUnits]
autoWpShapeInfo=inputShape->at(6);// projection weights [numUnits x numProj]
REQUIRE_TRUE(correctHt_1Shape==ht_1Shape,0,"LSTMCELL operation: wrong shape of initial cell output, expected is %s, but got %s instead !",correctHt_1Shape.c_str(),ht_1Shape.c_str());
REQUIRE_TRUE(correctCt_1Shape==ct_1Shape,0,"LSTMCELL operation: wrong shape of initial cell state, expected is %s, but got %s instead !",correctCt_1Shape.c_str(),ct_1Shape.c_str());
REQUIRE_TRUE(correctWxShape==WxShape,0,"LSTMCELL operation: wrong shape of input-to-hidden weights, expected is %s, but got %s instead !",correctWxShape.c_str(),WxShape.c_str());
REQUIRE_TRUE(correctWhShape==WhShape,0,"LSTMCELL operation: wrong shape of hidden-to-hidden weights, expected is %s, but got %s instead !",correctWhShape.c_str(),WhShape.c_str());
REQUIRE_TRUE(correctWcShape==WcShape,0,"LSTMCELL operation: wrong shape of diagonal weights for peephole connections, expected is %s, but got %s instead !",correctWcShape.c_str(),WcShape.c_str());
REQUIRE_TRUE(correctWpShape==WpShape,0,"LSTMCELL operation: wrong shape of projection weights, expected is %s, but got %s instead !",correctWpShape.c_str(),WpShape.c_str());
REQUIRE_TRUE(correctBShape==bShape,0,"LSTMCELL operation: wrong shape of biases, expected is %s, but got %s instead !",correctBShape.c_str(),bShape.c_str());