Description
Hi.
1, An Error Occurs when reproducing CAF
An error occurs when I reproduce CAF, in line trainer.fit(model, datamodule=data_module)
:
RuntimeError: It looks like your LightningModule has parameters that were not used in producing the loss returned by training_step. If this is intentional, you must enable the detection of unused parameters in DDP, either by setting the string value
strategy='ddp_find_unused_parameters_true'
or by setting the flag in the strategy withstrategy=DDPStrategy(find_unused_parameters=True)
.
2. A question about Data Normalization
And I think this line self.data.x[:, sens_idx] = self.data.sens
does not re-asign the sensitive value
To be specific, in the implementation of torch_geometric.data.Dataset,
The data object will be transformed before every access
which means that:
-
when executing
dataset = Bail(...,transform=NormalizeFeatures())
, featuresdataset[0].x
are not normalized. -
when executing
data = dataset[0]
(i.e. accessing data object), featuresdata.x
are implicitly normalized.
Yet this line self.data.x[:, sens_idx] = self.data.sens
is executed in dataset = Bail(...,transform=NormalizeFeatures())
, in other words, the re-asigning of sensitive values are executed beform feature normalization.
And you use Row-Normalization (torch_geometric.transforms.NormalizeFeatures
) in your code, resulting in a variety values of