public void SetRuntimeFeatures(State state, int curState, int numStates, int[] predicted, bool forward = true) { if (predicted != null && state.RuntimeFeatures != null) { // set runtime feature for (var i = 0; i < state.RuntimeFeatures.Length; i++) { for (var j = 0; j < OutputLayer.LayerSize; j++) { //Clean up run time feature value and then set a new one state.SetRuntimeFeature(i, j, 0); } var pos = curState + (forward ? 1 : -1) * state.RuntimeFeatures[i].OffsetToCurrentState; if (pos >= 0 && pos < numStates) { state.SetRuntimeFeature(i, predicted[pos], 1); } } } }
public void SetInputLayer(State state, int curState, int numStates, int[] predicted, bool forward = true) { if (predicted != null && state.RuntimeFeatures != null) { // set runtime feature for (int i = 0; i < state.RuntimeFeatures.Length; i++) { for (int j = 0; j < L2; j++) { //Clean up run time feature value and then set a new one state.SetRuntimeFeature(i, j, 0); } int pos = curState + ((forward == true) ? 1 : -1) * state.RuntimeFeatures[i].OffsetToCurrentState; if (pos >= 0 && pos < numStates) { state.SetRuntimeFeature(i, predicted[pos], 1); } } } neuFeatures = state.DenseData; }
public void SetInputLayer(State state, int curState, int numStates, int[] predicted, bool forward = true) { if (predicted != null && state.RuntimeFeatures != null) { // set runtime feature for (int i = 0; i < state.RuntimeFeatures.Length; i++) { for (int j = 0; j < OutputLayer.LayerSize; j++) { //Clean up run time feature value and then set a new one state.SetRuntimeFeature(i, j, 0); } int pos = curState + ((forward == true) ? 1 : -1) * state.RuntimeFeatures[i].OffsetToCurrentState; if (pos >= 0 && pos < numStates) { state.SetRuntimeFeature(i, predicted[pos], 1); } } } }