Skip to content

Releases: KevinMusgrave/pytorch-adapt

v0.0.73

30 May 00:03
7fe4441
Compare
Choose a tag to compare

Bug Fixes

v0.0.72

27 Apr 20:03
3b2713c
Compare
Choose a tag to compare

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

14 Apr 05:02
fed806d
Compare
Choose a tag to compare

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 just data

See the documentation

Code changes:
#61 by @deepseek-eoghan

v0.0.70

09 Apr 18:55
Compare
Choose a tag to compare

Many changes, may update this with details

v0.0.61

02 Mar 18:42
2ef1b96
Compare
Choose a tag to compare

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

28 Feb 22:04
0816a4a
Compare
Choose a tag to compare

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})