Skip to content

Instantly share code, notes, and snippets.

@keunwoochoi
Last active August 22, 2019 07:00
Show Gist options
  • Save keunwoochoi/98b901ee0f79ce46b3bb94a7bfd8980a to your computer and use it in GitHub Desktop.
Save keunwoochoi/98b901ee0f79ce46b3bb94a7bfd8980a to your computer and use it in GitHub Desktop.
def output_of_lambda(input_shape):
    return (input_shape[0], 1, input_shape[2])
def mean(x):
    return K.mean(x, axis=1, keepdims=True)
model.add(Lambda(mean, output_shape=output_of_lambda))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment