//+------------------------------------------------------------------+
//| mlp_.mq4 |
//| Copyright © 2008, MetaQuotes Software Corp. |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2008, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net"
#define IN 2
#define IN1 3 //IN+1
#define OUT 2
#define N_HU 3
#define N_HU1 4 //N_HU + 1
string m1;
//+------------------------------------------------------------------+
//| script program start function |
//+------------------------------------------------------------------+
int start()
{
//----
m1="";
PrintMLPInStr();
Comment(m1);
//----
return(0);
}
//+------------------------------------------------------------------+
void PrintMLPInStr()
{
int i, j;
// weights between hidden neurons and inputs
m1=m1+"\nweights between hidden neurons and inputs:\n";
for (i = 0; i<IN1; i++)
{
for (j = 0; j< N_HU1; j++)
{
//w1[j][i] = Random(-1.0, 1.0);
m1=m1+" w1["+j+"]["+i+"]";
}
m1=m1+"\n";
}
// weights between outputs and hidden neurons
m1=m1+"\nweights between outputs and hidden neurons:\n";
for (i = 0; i<OUT; i++)
{
for (j = 0; j< N_HU1; j++)
{
//w2[i][j] = Random(-1.0, 1.0);
m1=m1+" w2["+i+"]["+j+"]";
}
m1=m1+"\n";
}
}
Comments