- #1
ADDA
- 67
- 2
In this example:
The input multiplier to the artificial neural network, at the bottom of the screen, for each note is determined by an output of an Expectation Maxamazation sequence that converges after ten iterations with input of the artificial neural network's output above a threshhold.
First, does this code look correct?
I've adopted this code from this article:
http://www.cmi.ac.in/~madhavan/courses/datamining12/reading/em-tutorial.pdf
I might be doing something wrong in the E Step. Every theta is a conjugate of the other. Is that a desired result?
Second, would conditional feedback be plausible to even release to the general public? Is it a good idea? I've seen somewhere that 1/5 less of the max is desired for a runtime loop. Does that mean 0.2x or (1.0 - 0.2)x ? Seriously.
The input multiplier to the artificial neural network, at the bottom of the screen, for each note is determined by an output of an Expectation Maxamazation sequence that converges after ten iterations with input of the artificial neural network's output above a threshhold.
First, does this code look correct?
Java:
package com.adda.test;
public class EM {
public float[] theta;
private float[][] ml;
private boolean[][] input;
private int n, nsets, ncount;
public EM () {
this.n = 2;
this.ncount = CONSTANTS.NFRAMES_COUNT;
this.nsets = CONSTANTS.NFRAMES_SETS;
this.theta = new float[2];
this.ml = new float[this.nsets][this.n];
this.input = new boolean[this.nsets][this.ncount];
this.theta[0] = 0.45f;
this.theta[1] = 0.55f;
}
public void setInput(boolean[] notes) {
int itr, aitr, bitr;
bitr = 0;
for (itr = 0; itr < this.nsets; itr += 1) {
for (aitr = 0; aitr < this.ncount; aitr += 1) {
this.input[itr][aitr] = notes[bitr];
bitr += 1;
}
}
return;
}
private void EStep() {
int itr, c, aitr;
for (aitr = 0; aitr < this.nsets; aitr += 1) {
c = 0;
for (itr = 0; itr < this.ncount; itr += 1) {
if (this.input[aitr][itr]) c += 1;
}
this.ml[aitr][0] = this.theta[0] * ((float)(this.ncount - c) / (float)this.ncount);
this.ml[aitr][1] = this.theta[1] * ((float)c / (float)this.ncount);
}
return;
}
private void MStep() {
float[][] ntheta = new float[this.nsets][2];
int itr, c, aitr;
for (aitr = 0; aitr < this.nsets; aitr += 1) {
c = 0;
for (itr = 0; itr < this.ncount; itr += 1) {
if (this.input[aitr][itr]) c += 1;
}
ntheta[aitr][0] = (float)(this.ncount - c) * this.ml[aitr][0] + 0.1f;
ntheta[aitr][1] = (float)c * this.ml[aitr][1] + 0.1f;
}
this.theta[0] = ntheta[0][0] / (ntheta[0][0] + ntheta[0][1]);
this.theta[1] = ntheta[1][1] / (ntheta[1][0] + ntheta[1][1]);
return;
}
public void iterate() {
int itr;
for (itr = 0; itr < 10; itr += 1) {
this.EStep();
this.MStep();
}
return;
}
public boolean isOn() {
boolean ret = ( (this.theta[1] > CONSTANTS.THRESH) );
// if (ret)
System.out.print("\t" + ret + " " + this.theta[0] + " " + this.theta[1] + " ");
return ret;
}
}
I've adopted this code from this article:
http://www.cmi.ac.in/~madhavan/courses/datamining12/reading/em-tutorial.pdf
I might be doing something wrong in the E Step. Every theta is a conjugate of the other. Is that a desired result?
Second, would conditional feedback be plausible to even release to the general public? Is it a good idea? I've seen somewhere that 1/5 less of the max is desired for a runtime loop. Does that mean 0.2x or (1.0 - 0.2)x ? Seriously.