paleo/utils/save_layer.py
def save_conv_layer(filename, layer):
    """Save the layer into a individual file that can be run in isolation."""
    output_layer = dict()
    output_layer['name'] = layer.name
    output_layer['layers'] = {
        "data": {
            "parents": [],
            "type": "Input",
            "tensor": layer._inputs
        },
        ("%s" % layer.name): {
            "parents": ["data"],
            "type": "Convolution",
            "filter": layer._filters,
            "padding": layer._padding,
            "strides": layer._strides,
            "bias": layer._filters[-1]
        }
    }
    with open(filename, 'w') as f:
        f.write(json.dumps(output_layer, indent=4))
Save the layer into a individual file that can be run in isolation.
Save the layer into a individual file that can be run in isolation.
Save the layer into a individual file that can be run in isolation .
def save_conv_layer(filename, layer):
    output_layer = dict()
    output_layer['name'] = layer.name
    output_layer['layers'] = {
        "data": {
            "parents": [],
            "type": "Input",
            "tensor": layer._inputs
        },
        ("%s" % layer.name): {
            "parents": ["data"],
            "type": "Convolution",
            "filter": layer._filters,
            "padding": layer._padding,
            "strides": layer._strides,
            "bias": layer._filters[-1]
        }
    }
    with open(filename, 'w') as f:
        f.write(json.dumps(output_layer, indent=4))
def save_conv_layer ( filename , layer ) : output_layer = dict ( ) output_layer [ 'name' ] = layer . name output_layer [ 'layers' ] = { "data" : { "parents" : [ ] , "type" : "Input" , "tensor" : layer . _inputs } , ( "%s" % layer . name ) : { "parents" : [ "data" ] , "type" : "Convolution" , "filter" : layer . _filters , "padding" : layer . _padding , "strides" : layer . _strides , "bias" : layer . _filters [ - 1 ] } } with open ( filename , 'w' ) as f : f . write ( json . dumps ( output_layer , indent = 4 ) )
Save the layer into a individual file that can be run in isolation.
Save the layer into a individual file that can be run in isolation .
"""Save the layer into a individual file that can be run in isolation."""
filename
layer