def copy_weights(teacher_model, student_model, layer_names):
    """Copy weights from teacher_model to student_model,
     for layers with names listed in layer_names
    """
    for name in layer_names:
        weights = teacher_model.get_layer(name=name).get_weights()
        student_model.get_layer(name=name).set_weights(weights)
