def update(self, variables: Dict[str, Any]) -> SWAGState:
        """
        Update the SWAG state.

        Parameters
        ----------
        variables: Dict[str, Any]
            The attributes to update and their values.

        Returns
        -------
        SWAGState
            Updated SWAG state.
        """
        unchanged_keys = {k: v for k, v in vars(self).items() if k not in variables}
        return self.replace(**unchanged_keys, **variables)

        Update the SWAG state.

        Parameters
        ----------
        variables: Dict[str, Any]
            The attributes to update and their values.

        Returns
        -------
        SWAGState
            Updated SWAG state.
        
fortuna/prob_model/posterior/swag/swag_state.py