Save the encoder to `name` inside the model directory.

def save_encoder(self, name:str):
        "Save the encoder to `name` inside the model directory."
        encoder = get_model(self.model)[0]
        if hasattr(encoder, 'module'): encoder = encoder.module
        torch.save(encoder.state_dict(), self.path/self.model_dir/f'{name}.pth')