Skip to content

Initialize Method

Functions

initialize(self, layers)

Initialize the Sequential model with given layers.

Parameters:

Name Type Description Default
layers list

List of Layer instances to add to the model.

required
Note

This method is called internally by the Sequential constructor.

Source code in microkeras/models/sequential/initialize.py
def initialize(self, layers):
    """
    Initialize the Sequential model with given layers.

    Args:
        layers (list): List of Layer instances to add to the model.

    Note:
        This method is called internally by the Sequential constructor.
    """
    self.layers = []
    for layer in layers:
        self.add(layer)
    self.build()