Download tasks/bicycle_studio/solution/reference/preferences.py from Tokenwave-AI/REE: direct link, hf CLI and curl.
- Browser
- Download file 468 Bytes
-
https://huggingface.co/datasets/Tokenwave-AI/REE/resolve/main/tasks/bicycle_studio/solution/reference/preferences.py
- Command line
-
hf download hf://datasets/Tokenwave-AI/REE/tasks/bicycle_studio/solution/reference/preferences.py
-
curl -L -o preferences.py https://huggingface.co/datasets/Tokenwave-AI/REE/resolve/main/tasks/bicycle_studio/solution/reference/preferences.py
468 Bytes
| import numpy as np | |
| from das_dennis import das_dennis | |
| def uniform_pref(n_partition, n_obj, clip_eps=0, mtd='uniform'): | |
| if n_obj == 2: | |
| pref_1 = np.linspace(clip_eps, 1-clip_eps, n_partition) | |
| pref_2 = 1 - pref_1 | |
| prefs = np.stack((pref_1, pref_2), axis=1) | |
| else: | |
| prefs = das_dennis(n_partition, n_obj) | |
| prefs = np.clip(prefs, clip_eps, 1-clip_eps) | |
| prefs = prefs / prefs.sum(axis=1, keepdims=True) | |
| return prefs |