コード例 #1
0
def job_report_learn(context, combs):
    context = context.child('report_learn')
    rp = ReportProxy(context)
    for id_robot, id_agent in combs:
        context.needs(RM_AGENT_LEARN, id_robot=id_robot, id_agent=id_agent)
        
        f = rp.figure('%s-%s-model' % (id_robot, id_agent), cols=8,
                      caption='%s, %s' % (id_robot, id_agent))
        
        key = dict(report_type='agent_report', id_robot=id_robot, id_agent=id_agent)
        
        s = 'bds-%s-' % basename_from_key(dict(id_agent=id_agent, id_robot=id_robot))
        add = lambda n, nid: f.sub(rp.add_child_from_other(n, s + nid, **key), caption=nid)
        addif = lambda n, nid: f.sub(rp.add_child_from_other(n, s + nid, strict=False, **key), caption=nid)
        
        add('estimator/model/M/slices/0/normalized/png', 'M0')
        add('estimator/model/M/slices/1/normalized/png', 'M1')
        addif('estimator/model/M/slices/2/normalized/png', 'M2')
        add('estimator/model/N/slices/0/figure1/plot_scaled', 'N0')
        add('estimator/model/N/slices/1/figure1/plot_scaled', 'N1')
        addif('estimator/model/N/slices/2/figure1/plot_scaled', 'N2')
        
        f = rp.figure('%s-%s-learn' % (id_robot, id_agent), cols=8,
                      caption='%s, %s' % (id_robot, id_agent))
        
        add('estimator/tensors/T/slices/0/normalized/png', 'T0')
        add('estimator/tensors/T/slices/1/normalized/png', 'T1')
        addif('estimator/tensors/T/slices/2/normalized/png', 'T2')
        add('estimator/tensors/U/slices/0/figure1/plot_scaled', 'U0')
        add('estimator/tensors/U/slices/1/figure1/plot_scaled', 'U1')
        addif('estimator/tensors/U/slices/2/figure1/plot_scaled', 'U2')
                
        add('estimator/tensors/P/posneg', 'P')
        
    return rp.get_job()
コード例 #2
0
def report_summary_servo_theta(context, combinations, explogs_test):
    context = context.child('servo_theta')
    rp = ReportProxy(context)
    for id_robot, id_agent in combinations:
        context.needs(RM_AGENT_LEARN, id_robot=id_robot, id_agent=id_agent)
        
        f = rp.figure('%s-%s-servo_theta' % (id_robot, id_agent), cols=8,
                      caption='%s, %s' % (id_robot, id_agent))

        for e in explogs_test:

            key = dict(report_type='servo1', id_robot=id_robot,
                       id_agent=id_agent,
                       id_episode=e.id_episode)
        
            s = 'servo-%s-' % basename_from_key(dict(id_agent=id_agent,
                                                     id_robot=id_robot,
                                                     id_episode=e.id_episode))
            
            def add(url, nid, strict):
                r = rp.add_child_from_other(url, s + nid, strict=strict, ** key)
                f.sub(r, caption=nid)
        
            add('u/figure2/tw', 'u-tw', True)
            add('descent/figure2/tw', 'descent-tw', False)
        
    return rp.get_job()