bounds = config['Bounds']
encoded_bounds = {}
for feature, info in bounds.items():
if info['type'] == 'numeric':
encoded_bounds[feature] = info
elif info['type'] == 'categorical':
for value in info['values']:
encodedbounds[f"{feature}{value}"] = {'type': 'numeric', 'min': 0, 'max': 1}
変更内容
bounds[0]
をmin_bounds
bounds[1]
をmax_bounds
とし、何が何を表しているのか明確にした今後の変更について
現在のエラー
xprime
が25次元、min_bounds
とmax_bounds
は12次元であることからこれらは一致させるべきなのかという問題があるcloudeの提案として、
提案修正
min_bounds = torch.FloatTensor(min_bounds) max_bounds = torch.FloatTensor(max_bounds)
以下、既存のコード...
bounds = config['Bounds'] encoded_bounds = {} for feature, info in bounds.items(): if info['type'] == 'numeric': encoded_bounds[feature] = info elif info['type'] == 'categorical': for value in info['values']: encodedbounds[f"{feature}{value}"] = {'type': 'numeric', 'min': 0, 'max': 1}
... 残りのコード ...
if method == 'LowProFool': orig_pred, adv_pred, x_adv, loop_i = lowProFool(x_tensor, model, weights, encodedbounds, maxiters, alpha, lambda)
... 残りのコード ...