src/esn.cpp
Reservoir EchoBay::esn_config(const Eigen::VectorXd &optParams, YAML::Node confParams, 
                         const int Nu, const int guess, const std::string folder)
{
    // ESN general Parameters
    // Deep ESN
    int nLayers = parse_config<int>("Nl", -1, 0, optParams, confParams, 1);
    // Esn Topology
    int type = 0;
    if (confParams["ESNType"])
    {
        type = confParams["ESNType"].as<int>();
    }
    // Sampling
    int nWashout = parse_config<int>("washout_sample", -1, 0, optParams, confParams, 10);
    // Problem settings
    double lambda = parse_config<double>("lambda", -1, 0, optParams, confParams, 0);

    // Build Reservoir object
    Reservoir ESN(nLayers, Nu, type);

    // Configure ESN
    ESN.init_LayerConfig(optParams, confParams);

    if (folder != "")
    {
        // Initialize Echo State Network: Win, Wr, stateMat
        ESN.load_network(folder);
    }
    else
    {
        ESN.init_network();
    }

    // Print parameters
    if (guess == 0)
    {
        std::cout << "\nTopology: " << ESNTypes[type] << std::endl;
        ESN.print_params(nLayers, nWashout, lambda);
    }

    return ESN;
}
/**
 * @brief Configure or load an Echo State Network
 * 
 * @param optParams Eigen Vector used by Limbo to define hyper-parameters
 * @param confParams YAML Node containing hyper-parameters at high level
 * @param Nu Number of input channels
 * @param guess Number of guess (used for output)
 * @param folder Path to the folder where Reservoir matrices will be saved or loaded
 * @return Reservoir Configured Reservoir object
 */
@brief Configure or load an Echo State Network


@brief Configure or load an Echo State Network
Reservoir EchoBay::esn_config(const Eigen::VectorXd &optParams, YAML::Node confParams, 
                         const int Nu, const int guess, const std::string folder)
{
    int nLayers = parse_config<int>("Nl", -1, 0, optParams, confParams, 1);
    int type = 0;
    if (confParams["ESNType"])
    {
        type = confParams["ESNType"].as<int>();
    }
    int nWashout = parse_config<int>("washout_sample", -1, 0, optParams, confParams, 10);
    double lambda = parse_config<double>("lambda", -1, 0, optParams, confParams, 0);
    Reservoir ESN(nLayers, Nu, type);
    ESN.init_LayerConfig(optParams, confParams);
    if (folder != "")
    {
        ESN.load_network(folder);
    }
    else
    {
        ESN.init_network();
    }
    if (guess == 0)
    {
        std::cout << "\nTopology: " << ESNTypes[type] << std::endl;
        ESN.print_params(nLayers, nWashout, lambda);
    }
    return ESN;
}
Reservoir EchoBay :: esn_config ( const Eigen :: VectorXd & optParams , YAML :: Node confParams , const int Nu , const int guess , const std :: string folder ) { int nLayers = parse_config < int > ( " " , -1 , 0 , optParams , confParams , 1 ) ; int type = 0 ; if ( confParams [ " " ] ) { type = confParams [ " " ] . as < int > ( ) ; } int nWashout = parse_config < int > ( " " , -1 , 0 , optParams , confParams , 10 ) ; double lambda = parse_config < double > ( " " , -1 , 0 , optParams , confParams , 0 ) ; Reservoir ESN ( nLayers , Nu , type ) ; ESN . init_LayerConfig ( optParams , confParams ) ; if ( folder != " " ) { ESN . load_network ( folder ) ; } else { ESN . init_network ( ) ; } if ( guess == 0 ) { std :: cout << " \n " << ESNTypes [ type ] << std :: endl ; ESN . print_params ( nLayers , nWashout , lambda ) ; } return ESN ; }
@brief Configure or load an Echo State Network
@brief Configure or load an Echo State Network
// ESN general Parameters // Deep ESN // Esn Topology // Sampling // Problem settings // Build Reservoir object // Configure ESN // Initialize Echo State Network: Win, Wr, stateMat // Print parameters