# mlx.nn.Module.unfreeze — MLX 0.0.7 documentation

Skip to main content
`Ctrl`+`K`

# mlx.nn.Module.unfreeze

Module.unfreeze(*, recurse: bool = True, keys: Optional [ Union [ str , List [ str ]]] = None, strict: bool = False)

  Unfreeze the Module’s parameters or some of them.

  This function is idempotent ie unfreezing a model that is not frozen is a noop.

  Example

  For instance to only train the biases of a Transformer one can do:

      model = nn.Transformer()
      model.freeze()
      model.unfreeze(keys="bias")

  Parameters:

    - recurse (bool , optional) – If True then unfreeze the parameters of the submodules as well. Default: `True`.

    - keys (str or list [ str ], optional) – If provided then only these parameters will be unfrozen otherwise all the parameters of a module. For instance unfreeze all biases by calling `module.unfreeze(keys="bias")`.

    - strict (bool , optional) – If set to `True` validate that the passed keys exist. Default: `False`.