private Result getOptimizationConfig(){

        StatsStorage ss = knownSessionIDs.get(currentSessionID);
        if(ss == null){
            log.debug("getOptimizationConfig(): Session ID is unknown: {}", currentSessionID);
            return ok();
        }

        Persistable p = ss.getStaticInfo(currentSessionID, ARBITER_UI_TYPE_ID, GlobalConfigPersistable.GLOBAL_WORKER_ID);

        if(p == null){
            log.info("No static info");
            return ok();
        }

        List<Component> components = new ArrayList<>();

        GlobalConfigPersistable gcp = (GlobalConfigPersistable)p;
        OptimizationConfiguration oc = gcp.getOptimizationConfiguration();

        //Report optimization settings/configuration.
        String[] tableHeader = {"Configuration", "Value"};
        String [] dataSourceOrProvider;
        if (oc.getDataProvider() != null) {
            dataSourceOrProvider = new String[] {"Data Provider", oc.getDataProvider().toString()};
        }
        else {
            dataSourceOrProvider = new String[] {"Data Source", oc.getDataSource().getCanonicalName()};
        }
        String[][] table = new String[][]{
                {"Candidate Generator", oc.getCandidateGenerator().getClass().getSimpleName()},
                dataSourceOrProvider,
                {"Score Function", oc.getScoreFunction().toString()},
                {"Result Saver", oc.getResultSaver().toString()},
        };

        ComponentTable ct = new ComponentTable.Builder(STYLE_TABLE)
                .content(table)
                .header(tableHeader)
                .build();
        components.add(ct);


        String title = "Global Network Configuration";
        components.add(DIV_SPACER_20PX);
        components.add(new ComponentText.Builder(title, STYLE_TEXT_SZ12).build());
        BaseNetworkSpace<?> ps = (BaseNetworkSpace)oc.getCandidateGenerator().getParameterSpace();
        Map<String,ParameterSpace> m = ps.getNestedSpaces();

        String[][] hSpaceTable = new String[m.size()][2];
        int i=0;
        for(Map.Entry<String,ParameterSpace> e : m.entrySet()){
            hSpaceTable[i][0] = e.getKey();
            hSpaceTable[i][1] = e.getValue().toString();
            i++;
        }

        components.add(DIV_SPACER_20PX);
        String[] hSpaceTableHeader = new String[]{"Hyperparameter", "Hyperparameter Configuration"};

        ComponentTable ct2 = new ComponentTable.Builder(STYLE_TABLE)
                .content(hSpaceTable)
                .header(hSpaceTableHeader)
                .build();
        components.add(ct2);

        //Configuration for each layer:
        List<BaseNetworkSpace.LayerConf> layerConfs = ps.getLayerSpaces();
        for(BaseNetworkSpace.LayerConf l : layerConfs){
            LayerSpace<?> ls = l.getLayerSpace();
            Map<String,ParameterSpace> lpsm = ls.getNestedSpaces();

            String[][] t = new String[lpsm.size()][2];
            i=0;
            for(Map.Entry<String,ParameterSpace> e : lpsm.entrySet()){
                t[i][0] = e.getKey();
                t[i][1] = e.getValue().toString();
                i++;
            }

            ComponentTable ct3 = new ComponentTable.Builder(STYLE_TABLE)
                    .content(t)
                    .header(hSpaceTableHeader)
                    .build();

            title = "Layer Space: " + ls.getClass().getSimpleName() + ", Name: " + l.getLayerName();

            components.add(DIV_SPACER_20PX);
            components.add(new ComponentText.Builder(title, STYLE_TEXT_SZ12).build());
            components.add(ct3);
        }

        ComponentDiv cd = new ComponentDiv(STYLE_DIV_WIDTH_100_PC, components);

        return ok(asJson(cd)).as(JSON);
    }
private Result getOptimizationConfig ( ) { StatsStorage ss = knownSessionIDs . get ( currentSessionID ) ; if ( ss == null ) { log . debug ( "getOptimizationConfig(): Session ID is unknown: {}" , currentSessionID ) ; return ok ( ) ; } Persistable p = ss . getStaticInfo ( currentSessionID , ARBITER_UI_TYPE_ID , GlobalConfigPersistable . GLOBAL_WORKER_ID ) ; if ( p == null ) { log . info ( "No static info" ) ; return ok ( ) ; } List < Component > components = new ArrayList < > ( ) ; GlobalConfigPersistable gcp = ( GlobalConfigPersistable ) p ; OptimizationConfiguration oc = gcp . getOptimizationConfiguration ( ) ; String [ ] tableHeader = { "Configuration" , "Value" } ; String [ ] dataSourceOrProvider ; if ( oc . getDataProvider ( ) != null ) { dataSourceOrProvider = new String [ ] { "Data Provider" , oc . getDataProvider ( ) . toString ( ) } ; } else { dataSourceOrProvider = new String [ ] { "Data Source" , oc . getDataSource ( ) . getCanonicalName ( ) } ; } String [ ] [ ] table = new String [ ] [ ] { { "Candidate Generator" , oc . getCandidateGenerator ( ) . getClass ( ) . getSimpleName ( ) } , dataSourceOrProvider , { "Score Function" , oc . getScoreFunction ( ) . toString ( ) } , { "Result Saver" , oc . getResultSaver ( ) . toString ( ) } , } ; ComponentTable ct = new ComponentTable . Builder ( STYLE_TABLE ) . content ( table ) . header ( tableHeader ) . build ( ) ; components . add ( ct ) ; String title = "Global Network Configuration" ; components . add ( DIV_SPACER_20PX ) ; components . add ( new ComponentText . Builder ( title , STYLE_TEXT_SZ12 ) . build ( ) ) ; BaseNetworkSpace < ? > ps = ( BaseNetworkSpace ) oc . getCandidateGenerator ( ) . getParameterSpace ( ) ; Map < String , ParameterSpace > m = ps . getNestedSpaces ( ) ; String [ ] [ ] hSpaceTable = new String [ m . size ( ) ] [ 2 ] ; int i = 0 ; for ( Map . Entry < String , ParameterSpace > e : m . entrySet ( ) ) { hSpaceTable [ i ] [ 0 ] = e . getKey ( ) ; hSpaceTable [ i ] [ 1 ] = e . getValue ( ) . toString ( ) ; i ++ ; } components . add ( DIV_SPACER_20PX ) ; String [ ] hSpaceTableHeader = new String [ ] { "Hyperparameter" , "Hyperparameter Configuration" } ; ComponentTable ct2 = new ComponentTable . Builder ( STYLE_TABLE ) . content ( hSpaceTable ) . header ( hSpaceTableHeader ) . build ( ) ; components . add ( ct2 ) ; List < BaseNetworkSpace . LayerConf > layerConfs = ps . getLayerSpaces ( ) ; for ( BaseNetworkSpace . LayerConf l : layerConfs ) { LayerSpace < ? > ls = l . getLayerSpace ( ) ; Map < String , ParameterSpace > lpsm = ls . getNestedSpaces ( ) ; String [ ] [ ] t = new String [ lpsm . size ( ) ] [ 2 ] ; i = 0 ; for ( Map . Entry < String , ParameterSpace > e : lpsm . entrySet ( ) ) { t [ i ] [ 0 ] = e . getKey ( ) ; t [ i ] [ 1 ] = e . getValue ( ) . toString ( ) ; i ++ ; } ComponentTable ct3 = new ComponentTable . Builder ( STYLE_TABLE ) . content ( t ) . header ( hSpaceTableHeader ) . build ( ) ; title = "Layer Space: " + ls . getClass ( ) . getSimpleName ( ) + ", Name: " + l . getLayerName ( ) ; components . add ( DIV_SPACER_20PX ) ; components . add ( new ComponentText . Builder ( title , STYLE_TEXT_SZ12 ) . build ( ) ) ; components . add ( ct3 ) ; } ComponentDiv cd = new ComponentDiv ( STYLE_DIV_WIDTH_100_PC , components ) ; return ok ( asJson ( cd ) ) . as ( JSON ) ; }
Get the optimization configuration - second section in the page