def freeze(self, number=None):
        """ Freeze given number of layers in the model """
        if number is None:
            number = self.head_layers

        for idx, child in enumerate(self.model.children()):
            if idx < number:
                mu.freeze_layer(child)
def freeze ( self , number = None ) : if number is None : number = self . head_layers for idx , child in enumerate ( self . model . children ( ) ) : if idx < number : mu . freeze_layer ( child )
Freeze given number of layers in the model