harbor run -t openthoughts/tasktrove-exp-rle-github-issue-v3-5k-github-issue-3476harbor download openthoughts/tasktrove-exp-rle-github-issue-v3-5k-github-issue-3476Title: Implement adapt.utils module with data handling helpers, model/estimator validation and copying utilities, default Keras model builders, a gradient wrapper with a custom gradient, and synthetic data generators used by tests
Description: This task requires building a self-contained adapt.utils module (adapt/utils.py) that provides a collection of data handling helpers, model/estimator validation and copying utilities, default Keras model builders, a differentiable gradient wrapper, and synthetic data generators used by tests. All functionality must live in a single module and be compatible with the test suite (numpy, TensorFlow 2.x, scikit-learn, etc.). The implementation must preserve specific error messages and behaviors to satisfy tests that rely on substring checks. The tests also rely on a couple of helper concepts (e.g., CantBeDeepCopied) to stress certain paths; ensure those edge cases propagate correctly.
Functional requirements (to implement in adapt/utils.py)
network argument to be a Model instance, got: {no_net}"network argument can't be duplicated. Recorded exception: {exception_msg}"network argument is not compiled yet. Please use model.compile(optimizer, loss)."tireli argument is not compiled yet. Please use model.compile(optimizer, loss)." (where tireli is the display_name)estimator argument is a sklearn ClassifierMixin instance whereas the considered object handles only regression task. Please provide a sklearn RegressionMixin instance or a tensorflow Model instance."tireli argument is a sklearn ClassifierMixin instance " (where tireli is the display_name)estimator argument is a sklearn RegressionMixin instance whereas the considered object handles only classification task. Please provide a sklearn ClassifierMixin instance or a tensorflow Model instance."tireli argument is a sklearn RegressionMixin instance " (where tireli is the display_name)estimator argument can't be duplicated. Recorded exception: {exception_msg}"Self-contained requirements and constraints
Acceptance criteria (mapping to tests)
Deliverables
Testing/Verification steps (Steps to Reproduce)
Notes