Releases: KevinMusgrave/pytorch-adapt
Releases · KevinMusgrave/pytorch-adapt
v0.0.73
v0.0.72
Added a supervised
flag for dataset getters
Setting this to True
results in labeled target_train
and target_val
datasets.
Example:
from pytorch_adapt.datasets import get_mnist_mnistm
datasets = get_mnist_mnistm(
["mnist"],
["mnistm"],
folder=".",
supervised=True,
)
# datasets["target_train"] and datasets["target_val"] are of type TargetDataset, with self.supervised = True
Setting return_target_with_labels=True
returns type TargetDataset
instead of SourceDataset
Example:
from pytorch_adapt.datasets import get_mnist_mnistm
datasets = get_mnist_mnistm(
["mnist"],
["mnistm"],
folder=".",
return_target_with_labels=True,
)
# datasets["target_train_with_labels"] and datasets["target_val_with_labels"] are of type TargetDataset
Thanks to @deepseek-eoghan for the contribution.
v0.0.71
Improvements to TargetDataset
- A new
supervised
flag, for switching between supervised and unsupervised domain adaptation. - Allow the wrapped dataset to return either
(data, label)
or justdata
See the documentation
Code changes:
#61 by @deepseek-eoghan
v0.0.70
Many changes, may update this with details
v0.0.61
Debugging messages are appended to the traceback when an exception occurs inside a hook (#24).
For example:
Old behavior:
Traceback (most recent call last):
...
TypeError: forward() takes 2 positional arguments but 3 were given
New behavior:
Traceback (most recent call last):
...
TypeError: in GVBHook: __call__
in ChainHook: __call__
in OptimizerHook: __call__
in ChainHook: __call__
in FeaturesLogitsAndGBridge: __call__
in GBridgeAndLogitsHook: __call__
GBridgeAndLogitsHook: Getting src
GBridgeAndLogitsHook: Getting output: ['src_imgs_features_logits', 'src_imgs_features_gbridge']
GBridgeAndLogitsHook: Using model C with inputs: src_imgs_features, return_bridge
forward() takes 2 positional arguments but 3 were given
C.forward() signature is (input: torch.Tensor) -> torch.Tensor
v0.0.60
Swapped order of input and output argument of hooks.
Before | After |
---|---|
losses, output = hook(losses, inputs) | output, losses = hook(inputs, losses) |
The loss input argument is now optional, which makes the top level syntax cleaner:
# old
hook({}, {**models, **data})
# new
hook({**models, **data})