def plus(cntk_layer, inputs): ''' Setup plus op with given parameters Args: cntk_layer (:class:`~cntk.contrib.crosstalkcaffe.unimodel.cntkmodel.CntkLayersDefinition`): the layer definition of dense op inputs (list): a list contains all :class:`~cntk.ops.functions.Function` or :class:`~cntk.input` Return: :func:`~cntk.ops.functions.Function`: instaced cntk dense op ''' sanitize_left = ops.sanitize_input(inputs[0]) sanitize_right = ops.sanitize_input(inputs[1]) return ops.plus(sanitize_left, sanitize_right, name=cntk_layer.op_name)
def softmax(cntk_layer, inputs): ''' Setup softmax op with given parameters Args: cntk_layer (:class:`~cntk.contrib.crosstalkcaffe.unimodel.cntkmodel.CntkLayersDefinition`): the layer definition of softmax op inputs (list): a list contains all :class:`~cntk.ops.functions.Function` or :class:`~cntk.input` Return: :func:`~cntk.ops.functions.Function`: instaced cntk softmax op ''' sanitize_output = ops.sanitize_input(inputs[0]) return ops.softmax(sanitize_output, name=cntk_layer.op_name)
def lrn(cntk_layer, inputs): ''' Setup lrn op with given parameters Args: cntk_layer (:class:`~cntk.contrib.crosstalkcaffe.unimodel.cntkmodel.CntkLayersDefinition`): the layer definition of lrn op inputs (list): a list contains all :class:`~cntk.ops.functions.Function` or :class:`~cntk.input` Return: :func:`~cntk.ops.functions.Function`: instaced cntk lrn op ''' sanitize_output = ops.sanitize_input(inputs[0]) params = cntk_layer.parameters return BlockApiSetup.lrn(params.k, params.kernel_size, params.alpha, params.beta, cntk_layer.op_name)(sanitize_output)