<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def as_dict(self) -> Dict[str, Any]: """Converts to a dict of attributes for easier serialization."""

        def _on_filter(obj: Any, name: str) -> bool:
            # Filter out any callbacks
            if isinstance(obj, BaseUnit):
                if name.startswith('on_'):
                    return False
            return True

        return serializable(self, on_filter=_on_filter)