SMILE.NET Learning: EM

From DSL

Jump to: navigation, search

This class implements the EM parameter learning algorithm for discrete variables.

[edit] Interfaces

  • IDisposable

The .NET garbage collector automatically releases the memory allocated to objects when they are no longer used. It is, however, unpredictable when garbage collection will occur. Furthermore, the garbage collector has no knowledge of unmanaged resources such as the DSL_em C++ object wrapped by EM. The IDisposable.Dispose() method provides means to ensure that wrapped object is deleted before garbage collection occurs:

  EM em = new EM();
  try {
    // use em here
  }
  finally {
    if (em != null) em.Dispose();
  }

C# has the using statement, which is equivalent to the try/finally/Dispose construct in the preceding example:

  using (EM em = new EM()) {
    // use em here
  }


[edit] Properties

  • int EqSampleSize (get, set)

The equivalent sample size (defaults to 0).


  • bool RandomizeParameters (get, set)

Indicates if the parameters will be randomized when the EqSampleSize is equal to 0 (defaults to true).


[edit] Methods

  • void Learn(DataSet data, Network net)

Uses the data set to learn the parameters in the network. This method can throw a SmileException.

Personal tools