Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add Keras API #4

@MaximeKjaer

Description

@MaximeKjaer

The Keras API is TensorFlow's high-level API for building deep learning models. It defines a model as a series of successive layers, each of which has an input and output shape.

Some interesting Keras layers:

  • Reshape, which requires the output shape to have the same number of elements as the inputs
  • Flatten, which has an output shape determined by the input shape (the product of the dimensions)

The functional API especially could be typed by tf-dotty (as long as each layer is assigned to a different variable, unlike in the Python sample below)

encoder_input = keras.Input(shape=(28, 28, 1), name='img')
x = layers.Conv2D(16, 3, activation='relu')(encoder_input)
x = layers.Conv2D(32, 3, activation='relu')(x)
x = layers.MaxPooling2D(3)(x)
x = layers.Conv2D(32, 3, activation='relu')(x)
x = layers.Conv2D(16, 3, activation='relu')(x)
encoder_output = layers.GlobalMaxPooling2D()(x)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions