Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| train_dataset = train_x | ||
| preference_dataset = {"x_prefer": {}, "y_prefer": {}} | ||
| for x, xp, yp in train_x, x_prefer, y_prefer: | ||
| preference_dataset["x_prefer"][x] = xp | ||
| preference_dataset["y_prefer"][x] = yp |
There was a problem hiding this comment.
Build preference dataset without zipping iterables
The loop that is supposed to pair train_x, x_prefer, and y_prefer iterates over the three tensors as a tuple and tries to unpack each entire tensor into (x, xp, yp). For any non‑trivial dataset this raises ValueError: too many values to unpack (expected 3) before the dictionary is populated. In addition, the loop stores the tensors as dictionary keys, but torch.Tensor objects are unhashable, so even after fixing the iteration the code will crash with TypeError: unhashable type: 'Tensor'. This makes load_adult_preference_dataset unusable for training with example-based constraints.
Useful? React with 👍 / 👎.
| for column in dataloader.categorical_feature_names: | ||
| diff_count += np.sum( | ||
| np.array(x_ori[column], dtype=pd.Series) | ||
| != np.array(x_pred[column], dtype=pd.Series) |
There was a problem hiding this comment.
Invalid dtype when comparing categorical proximity
The categorical proximity metric converts each column with np.array(x_ori[column], dtype=pd.Series). pd.Series is not a valid NumPy dtype, so calling this function raises TypeError: data type 'pandas.core.series.Series' not understood before any comparison occurs. This prevents cat_proximity from running and breaks the evaluation pipeline for CFVAE.
Useful? React with 👍 / 👎.
No description provided.