def get_layer_lr_mult(layer):
    """Get the learning rate multipliers.

    Get the learning rate multipliers for the given layer. Assumes a
    Convolution/Deconvolution/InnerProduct layer.

    Parameters
    ----------
    layer : caffe_pb2.LayerParameter
        A Convolution, Deconvolution, or InnerProduct layer.

    Returns
    -------
    learning_rates : tuple of floats
        the learning rate multipliers for the weights and biases.
    """
    if layer.type not in ['Convolution', 'Deconvolution', 'InnerProduct']:
        raise ValueError("%s layers do not have a "
                         "learning rate multiplier" % layer.type)

    if not hasattr(layer, 'param'):
        return (1.0, 1.0)

    params = getattr(layer, 'param')

    if len(params) == 0:
        return (1.0, 1.0)

    if len(params) == 1:
        lrm0 = getattr(params[0],'lr_mult', 1.0)
        return (lrm0, 1.0)

    if len(params) == 2:
        lrm0, lrm1 = [getattr(p,'lr_mult', 1.0) for p in params]
        return (lrm0, lrm1)

    raise ValueError("Could not parse the learning rate multiplier")