(filename, cost_data, deconv_data)
Generate an HTML page with a Deconv visualization

    Arguments:
        filename: Output filename
        cost_data (list): Cost data to plot
        deconv_data (tuple): deconv data to plot
Generate an HTML page with a Deconv visualization
Generate an HTML page with a Deconv visualization
def deconv_summary_page(filename, cost_data, deconv_data):
    """
    Generate an HTML page with a Deconv visualization

    Arguments:
        filename: Output filename
        cost_data (list): Cost data to plot
        deconv_data (tuple): deconv data to plot
    """
    fig_dict = dict()

    cost_key = "cost_plot"
    fig_dict[cost_key] = cost_fig(cost_data, 300, 533, epoch_axis=True)

    vis_keys = dict()
    img_keys = dict()
    for layer, layer_data in deconv_data:
        lyr_vis_keys, lyr_img_keys, lyr_fig_dict = deconv_figs(layer, layer_data, fm_max=4)
        vis_keys[layer] = lyr_vis_keys
        img_keys[layer] = lyr_img_keys
        fig_dict.update(lyr_fig_dict)

    script, div = components(fig_dict)

    template = Template('''
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <title>{{page_title}}</title>
        <style> div{float: left;} </style>
        <link rel="stylesheet"
              href="http://cdn.pydata.org/bokeh/release/bokeh-0.9.0.min.css"
              type="text/css" />
        <script type="text/javascript"
                src="http://cdn.pydata.org/bokeh/release/bokeh-0.9.0.min.js"></script>
        {{ script }}
    </head>
    <body>
    <div id=cost_plot style="width:100%; padding:10px">
      {{ div[cost_key]}}
    </div>

    {% for layer in sorted_layers %}
        <div id=Outer{{layer}} style="padding:20px">
        <div id={{layer}} style="background-color: #C6FFF1; padding:10px">
        Layer {{layer}}<br>
        {% for fm in vis_keys[layer].keys() %}
            <div id={{fm}} style="padding:10px">
            Feature Map {{fm}}<br>
            {{ div[vis_keys[layer][fm]] }}
            {{ div[img_keys[layer][fm]] }}
            </div>
        {% endfor %}
        </div>
        </div>

        <br><br>
    {% endfor %}
    </body>
</html>
''')

    with open(filename, 'w') as htmlfile:
        htmlfile.write(template.render(page_title="Deconv Visualization", script=script,
                                       div=div, cost_key=cost_key, vis_keys=vis_keys,
                                       img_keys=img_keys,
                                       sorted_layers=sorted(vis_keys)))
def deconv_summary_page ( filename , cost_data , deconv_data ) : fig_dict = dict ( ) cost_key = "cost_plot" fig_dict [ cost_key ] = cost_fig ( cost_data , 300 , 533 , epoch_axis = True ) vis_keys = dict ( ) img_keys = dict ( ) for layer , layer_data in deconv_data : lyr_vis_keys , lyr_img_keys , lyr_fig_dict = deconv_figs ( layer , layer_data , fm_max = 4 ) vis_keys [ layer ] = lyr_vis_keys img_keys [ layer ] = lyr_img_keys fig_dict . update ( lyr_fig_dict ) script , div = components ( fig_dict ) template = Template ( '''
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <title>{{page_title}}</title>
        <style> div{float: left;} </style>
        <link rel="stylesheet"
              href="http://cdn.pydata.org/bokeh/release/bokeh-0.9.0.min.css"
              type="text/css" />
        <script type="text/javascript"
                src="http://cdn.pydata.org/bokeh/release/bokeh-0.9.0.min.js"></script>
        {{ script }}
    </head>
    <body>
    <div id=cost_plot style="width:100%; padding:10px">
      {{ div[cost_key]}}
    </div>

    {% for layer in sorted_layers %}
        <div id=Outer{{layer}} style="padding:20px">
        <div id={{layer}} style="background-color: #C6FFF1; padding:10px">
        Layer {{layer}}<br>
        {% for fm in vis_keys[layer].keys() %}
            <div id={{fm}} style="padding:10px">
            Feature Map {{fm}}<br>
            {{ div[vis_keys[layer][fm]] }}
            {{ div[img_keys[layer][fm]] }}
            </div>
        {% endfor %}
        </div>
        </div>

        <br><br>
    {% endfor %}
    </body>
</html>
''' ) with open ( filename , 'w' ) as htmlfile : htmlfile . write ( template . render ( page_title = "Deconv Visualization" , script = script , div = div , cost_key = cost_key , vis_keys = vis_keys , img_keys = img_keys , sorted_layers = sorted ( vis_keys ) ) )