예제 #1
0
    public string GetPhrase(int phraseIndex)
    {
        XmmInterface.setCurrentSetInstance(thisIndex);

        IntPtr phraseIntPtr = XmmInterface.getPhrase(phraseIndex);

        return(Marshal.PtrToStringAnsi(phraseIntPtr));
    }
예제 #2
0
    public float[] getRegression()
    {
        int nModels = XmmInterface.getNbOfModels();

        float[] outputValues       = new float[nModels];
        IntPtr  intPtrOutputValues = XmmInterface.getLikelihoods();

        Marshal.Copy(intPtrOutputValues, outputValues, 0, nModels);
        return(outputValues);
    }
예제 #3
0
    public float[] getTimeProgressions()
    {
        int nModels = XmmInterface.getNbOfModels();

        float[] timeProgressions       = new float[nModels];
        IntPtr  intPtrTimeProgressions = XmmInterface.getTimeProgressions();

        Marshal.Copy(intPtrTimeProgressions, timeProgressions, 0, nModels);
        return(timeProgressions);
    }
예제 #4
0
    public float[] getLikelihoods()
    {
        int nModels = XmmInterface.getNbOfModels();

        float[] likelihoods       = new float[nModels];
        IntPtr  intPtrLikelihoods = XmmInterface.getLikelihoods();

        Marshal.Copy(intPtrLikelihoods, likelihoods, 0, nModels);
        return(likelihoods);
    }
예제 #5
0
    public void filter(float[] observation)
    {
        IntPtr intPtrFArray = Marshal.AllocHGlobal(observation.Length * sizeof(float));

        Marshal.Copy(observation, 0, intPtrFArray, observation.Length);

        XmmInterface.filter(intPtrFArray, observation.Length);

        Marshal.FreeHGlobal(intPtrFArray);
    }
예제 #6
0
    public float[] GetTimeProgressions()
    {
        XmmInterface.setCurrentModelInstance(thisIndex);

        int nModels = XmmInterface.getNbOfModels();

        float[] timeProgressions       = new float[nModels];
        IntPtr  intPtrTimeProgressions = XmmInterface.getTimeProgressions();

        Marshal.Copy(intPtrTimeProgressions, timeProgressions, 0, nModels);
        return(timeProgressions);
    }
예제 #7
0
    //==========================================================================//
    //================= Wrapper methods for the native plugin ==================//
    //==========================================================================//

    public void addPhraseFromData(string label, string[] colNames, float[] phrase,
                                  int dimIn, int dimOut)
    {
        IntPtr unmanagedFArray = Marshal.AllocHGlobal(phrase.Length * sizeof(float));

        Marshal.Copy(phrase, 0, unmanagedFArray, phrase.Length);

        XmmInterface.addPhraseFromData(label, colNames, unmanagedFArray,
                                       dimIn, dimOut, phrase.Length / (dimIn + dimOut));

        Marshal.FreeHGlobal(unmanagedFArray);
    }
예제 #8
0
    public float[] GetRegression()
    {
        XmmInterface.setCurrentModelInstance(thisIndex);

        int nModels = XmmInterface.getNbOfModels();

        float[] outputValues       = new float[nModels];
        IntPtr  intPtrOutputValues = XmmInterface.getLikelihoods();

        Marshal.Copy(intPtrOutputValues, outputValues, 0, nModels);
        return(outputValues);
    }
예제 #9
0
    public float[] GetLikelihoods()
    {
        XmmInterface.setCurrentModelInstance(thisIndex);

        int nModels = XmmInterface.getNbOfModels();

        float[] likelihoods       = new float[nModels];
        IntPtr  intPtrLikelihoods = XmmInterface.getLikelihoods();

        Marshal.Copy(intPtrLikelihoods, likelihoods, 0, nModels);
        return(likelihoods);
    }
예제 #10
0
    public void Filter(float[] observation)
    {
        XmmInterface.setCurrentModelInstance(thisIndex);

        IntPtr intPtrFArray = Marshal.AllocHGlobal(observation.Length * sizeof(float));

        Marshal.Copy(observation, 0, intPtrFArray, observation.Length);

        XmmInterface.filter(intPtrFArray, observation.Length);

        Marshal.FreeHGlobal(intPtrFArray);
    }
예제 #11
0
    public string[] getTrainingSetLabels()
    {
        int nLabels = XmmInterface.getTrainingSetNbOfLabels();

        string[] labels            = new string[nLabels];
        IntPtr   stringArrayIntPtr = XmmInterface.getTrainingSetLabels();

        for (int i = 0; i < nLabels; i++)
        {
            IntPtr currentIntPtr = Marshal.ReadIntPtr(stringArrayIntPtr, i * IntPtr.Size);
            labels[i] = Marshal.PtrToStringAnsi(currentIntPtr);
        }

        return(labels);
    }
예제 #12
0
    public string[] GetLabels()
    {
        XmmInterface.setCurrentModelInstance(thisIndex);

        int nLabels = XmmInterface.getNbOfModels();

        string[] labels            = new string[nLabels];
        IntPtr   stringArrayIntPtr = XmmInterface.getModelLabels();

        for (int i = 0; i < nLabels; i++)
        {
            IntPtr currentIntPtr = Marshal.ReadIntPtr(stringArrayIntPtr, i * IntPtr.Size);
            labels[i] = Marshal.PtrToStringAnsi(currentIntPtr);
        }

        return(labels);
    }
예제 #13
0
 public void Clear()
 {
     XmmInterface.setCurrentModelInstance(thisIndex);
     XmmInterface.clearModel();
 }
예제 #14
0
    //==========================================================================//

    public int GetLikelihoodWindow()
    {
        XmmInterface.setCurrentModelInstance(thisIndex);
        return(XmmInterface.getLikelihoodWindow());
    }
예제 #15
0
 public void SetLikelihoodWindow(int window)
 {
     XmmInterface.setCurrentModelInstance(thisIndex);
     XmmInterface.setLikelihoodWindow(window);
 }
예제 #16
0
 public void SetTransitionMode(int transitionMode)
 {
     XmmInterface.setCurrentModelInstance(thisIndex);
     XmmInterface.setTransitionMode(transitionMode);
 }
예제 #17
0
 public void SetRegressionEstimator(int regressionEstimator)
 {
     XmmInterface.setCurrentModelInstance(thisIndex);
     XmmInterface.setRegressionEstimator(regressionEstimator);
 }
예제 #18
0
 public int GetStates()
 {
     XmmInterface.setCurrentModelInstance(thisIndex);
     return(XmmInterface.getStates());
 }
예제 #19
0
 public bool GetHierarchical()
 {
     XmmInterface.setCurrentModelInstance(thisIndex);
     return(XmmInterface.getHierarchical() != 0);
 }
예제 #20
0
 public string GetFilteringResults()
 {
     XmmInterface.setCurrentModelInstance(thisIndex);
     return(Marshal.PtrToStringAnsi(XmmInterface.getFilteringResults()));
 }
예제 #21
0
 public int GetTransitionMode()
 {
     XmmInterface.setCurrentModelInstance(thisIndex);
     return(XmmInterface.getTransitionMode());
 }
예제 #22
0
 public void SetRelativeRegularization(float relReg)
 {
     XmmInterface.setCurrentModelInstance(thisIndex);
     XmmInterface.setRelativeRegularization(relReg);
 }
예제 #23
0
    //==========================================================================//

    public void SetGaussians(int gaussians)
    {
        XmmInterface.setCurrentModelInstance(thisIndex);
        XmmInterface.setGaussians(gaussians);
    }
예제 #24
0
 public int GetRegressionEstimator()
 {
     XmmInterface.setCurrentModelInstance(thisIndex);
     return(XmmInterface.getRegressionEstimator());
 }
예제 #25
0
 public string GetLikeliest()
 {
     XmmInterface.setCurrentModelInstance(thisIndex);
     return(Marshal.PtrToStringAnsi(XmmInterface.getLikeliest()));
 }
예제 #26
0
 public void SetHierarchical(bool hierarchical)
 {
     XmmInterface.setCurrentModelInstance(thisIndex);
     XmmInterface.setHierarchical(hierarchical ? 1 : 0);
 }
예제 #27
0
 public void SetAbsoluteRegularization(float absReg)
 {
     XmmInterface.setCurrentModelInstance(thisIndex);
     XmmInterface.setAbsoluteRegularization(absReg);
 }
예제 #28
0
 public void SetStates(int states)
 {
     XmmInterface.setCurrentModelInstance(thisIndex);
     XmmInterface.setStates(states);
 }
예제 #29
0
 public void Reset()
 {
     XmmInterface.setCurrentModelInstance(thisIndex);
     XmmInterface.reset();
 }
예제 #30
0
 public void SetCovarianceMode(int covarianceMode)
 {
     XmmInterface.setCurrentModelInstance(thisIndex);
     XmmInterface.setCovarianceMode(covarianceMode);
 }