Ejemplo n.º 1
0
    def parse(self, name, mcp, prev_layers, model):
        dic = CostParser.parse(self, name, mcp, prev_layers, model)
        if dic['numInputs'][0] != 1: # first input must be labels
            raise LayerParsingError("Layer '%s': dimensionality of first input must be 1" % name)
        dic['channels'] = mcp.safe_get_int(name, 'channels')
        dic['imgSize'] = mcp.safe_get_int(name, 'imgSize')

        print "Initialized groupSparsityInLabel cost '%s' with %d channels and %dx%d inputs" % (name, dic['channels'], dic['imgSize'], dic['imgSize'])
        return dic
Ejemplo n.º 2
0
    def parse(self, name, mcp, prev_layers, model):
        dic = CostParser.parse(self, name, mcp, prev_layers, model)
        if dic['numInputs'][0] != 1:  # first input must be labels
            raise LayerParsingError(
                "Layer '%s': dimensionality of first input must be 1" % name)
        dic['channels'] = mcp.safe_get_int(name, 'channels')
        dic['imgSize'] = mcp.safe_get_int(name, 'imgSize')

        print "Initialized groupSparsityInLabel cost '%s' with %d channels and %dx%d inputs" % (
            name, dic['channels'], dic['imgSize'], dic['imgSize'])
        return dic
Ejemplo n.º 3
0
 def __init__(self):
     CostParser.__init__(self, num_inputs=2)
Ejemplo n.º 4
0
 def __init__(self):
     CostParser.__init__(self, num_inputs=2)