You can get more information on how to set the model weight in the Keras Layers Documentation . You mainly use:
layer.set_weights(weights) : sets the weight of a layer from a list of Numpy arrays (with the same shapes as get_weights output).
Or you can directly initialize them when creating a layer. Each layer has a weights parameter that can be set using the numpy array. Read the documentation for each level to copy the format of the correct weights. For example, Dense() layers accept this format for the weights parameter:
List of Numpy arrays to set as starting weights. The list should contain 2 elements, forms (input_dim, output_dim) and (output_dim,) for weights and offsets, respectively. a source
source share