Spaces:
Sleeping
Sleeping
Download hypervolume.py from kode24/Usecase_3_Active_Learn: direct link, hf CLI and curl.
- Browser
- Download file 495 Bytes
-
https://huggingface.co/spaces/kode24/Usecase_3_Active_Learn/resolve/main/hypervolume.py
- Command line
-
hf download hf://spaces/kode24/Usecase_3_Active_Learn/hypervolume.py
-
curl -L -o hypervolume.py https://huggingface.co/spaces/kode24/Usecase_3_Active_Learn/resolve/main/hypervolume.py
495 Bytes
| # -*- coding: utf-8 -*- | |
| """ | |
| Created on Fri Mar 16 12:17:20 2018 | |
| @author: r.dewinter | |
| """ | |
| from pygmo import hypervolume as hvv | |
| from numpy import all | |
| def hypervolume(pointset, ref): | |
| """Compute the absolute hypervolume of a *pointset* according to the | |
| reference point *ref*. | |
| """ | |
| pointset = pointset[all(pointset<=ref,axis=1)] | |
| if len(pointset)==0: | |
| return 0 | |
| hv = hvv(pointset) | |
| contribution = hv.compute(ref) | |
| return contribution |