EncogWorkBench.getInstance().getMainWindow().getTabManager()
.openModalTab(tab, "Analyze Weights");
}
public void produceReport() {
HTMLReport report = new HTMLReport();
report.beginHTML();
report.title("MLMethod");
report.beginBody();
report.h1(this.method.getClass().getSimpleName());
report.beginTable();
if (method instanceof MLInput) {
MLInput reg = (MLInput) method;
report.tablePair("Input Count",
Format.formatInteger(reg.getInputCount()));
}
if (method instanceof MLOutput) {
MLOutput reg = (MLOutput) method;
report.tablePair("Output Count",
Format.formatInteger(reg.getOutputCount()));
}
if (method instanceof MLEncodable) {
MLEncodable encode = (MLEncodable)method;
report.tablePair("Encoded Length",
Format.formatInteger(encode.encodedArrayLength()));
}
report.tablePair("Resettable",
(method instanceof MLResettable) ? "true" : "false");
report.tablePair("Context",
(method instanceof MLContext) ? "true" : "false");
if( method instanceof NEATNetwork ) {
NEATNetwork neat = (NEATNetwork)method;
report.tablePair("Output Activation Function", neat.getOutputActivationFunction().getClass().getSimpleName());
report.tablePair("NEAT Activation Function", neat.getActivationFunction().getClass().getSimpleName());
}
if( method instanceof CPN ) {
CPN cpn = (CPN)method;
report.tablePair("Instar Count", Format.formatInteger(cpn.getInstarCount()));
report.tablePair("Outstar Count", Format.formatInteger(cpn.getOutstarCount()));
}
report.endTable();
if (this.method instanceof RBFNetwork) {
RBFNetwork rbfNetwork = (RBFNetwork)this.method;
report.h3("RBF Centers");
report.beginTable();
report.beginRow();
report.header("RBF");
report.header("Peak");
report.header("Width");
for(int i=1;i<=rbfNetwork.getInputCount();i++) {
report.header("Center " + i);
}
report.endRow();
for( RadialBasisFunction rbf : rbfNetwork.getRBF() ) {
report.beginRow();
report.cell(rbf.getClass().getSimpleName());
report.cell(Format.formatDouble(rbf.getPeak(), 5));
report.cell(Format.formatDouble(rbf.getWidth(), 5));
for(int i=0;i<rbfNetwork.getInputCount();i++) {
report.cell(Format.formatDouble(rbf.getCenter(i), 5));
}
report.endRow();
}
}
if (this.method instanceof BasicNetwork) {
report.h3("Layers");
report.beginTable();
report.beginRow();
report.header("Layer #");
report.header("Total Count");
report.header("Neuron Count");
report.header("Activation Function");
report.header("Bias");
report.header("Context Target Size");
report.header("Context Target Offset");
report.header("Context Count");
report.endRow();
BasicNetwork network = (BasicNetwork) method;
FlatNetwork flat = network.getStructure().getFlat();
int layerCount = network.getLayerCount();
for (int l = 0; l < layerCount; l++) {
report.beginRow();
StringBuilder str = new StringBuilder();
str.append(Format.formatInteger(l + 1));
if (l == 0) {
str.append(" (Output)");
} else if (l == network.getLayerCount() - 1) {
str.append(" (Input)");
}
report.cell(str.toString());
report.cell(Format.formatInteger(flat.getLayerCounts()[l]));
report.cell(Format.formatInteger(flat.getLayerFeedCounts()[l]));
report.cell(flat.getActivationFunctions()[l].getClass()
.getSimpleName());
report.cell(Format.formatDouble(flat.getBiasActivation()[l], 4));
report.cell(Format.formatInteger(flat.getContextTargetSize()[l]));
report.cell(Format.formatInteger(flat.getContextTargetOffset()[l]));
report.cell(Format.formatInteger(flat.getLayerContextCount()[l]));
report.endRow();
}
report.endTable();
}
report.endBody();
report.endHTML();
this.editor.setText(report.toString());
}