mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-04-25 04:46:23 +02:00
Merge branch 'devel' into switch-to-poetry
This commit is contained in:
commit
70b00abe19
7 changed files with 24166 additions and 17723 deletions
24
.github/workflows/test-and-deploy.yml
vendored
24
.github/workflows/test-and-deploy.yml
vendored
|
|
@ -28,7 +28,7 @@ jobs:
|
|||
with:
|
||||
python-version: ${{ matrix.python }}
|
||||
|
||||
- name: Install dependencies
|
||||
- name: Install build dependencies
|
||||
run: |
|
||||
pip install poetry
|
||||
|
||||
|
|
@ -36,7 +36,11 @@ jobs:
|
|||
run: |
|
||||
poetry install
|
||||
|
||||
- name: pytest
|
||||
- name: Install lib
|
||||
run: |
|
||||
python setup.py develop
|
||||
|
||||
- name: pytest
|
||||
run: |
|
||||
poetry run pytest
|
||||
|
||||
|
|
@ -55,7 +59,7 @@ jobs:
|
|||
with:
|
||||
python-version: ${{ matrix.python }}
|
||||
|
||||
- name: Install dependencies
|
||||
- name: Install build dependencies
|
||||
run: |
|
||||
pip install poetry
|
||||
|
||||
|
|
@ -66,6 +70,7 @@ jobs:
|
|||
- name: pytest
|
||||
run: |
|
||||
poetry run pytest
|
||||
|
||||
test-macos:
|
||||
strategy:
|
||||
matrix:
|
||||
|
|
@ -159,12 +164,11 @@ jobs:
|
|||
matrix:
|
||||
python: ['cp39-cp39', 'cp310-cp310', 'cp311-cp311', 'cp312-cp312']
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: quay.io/pypa/manylinux2014_x86_64
|
||||
container: quay.io/pypa/manylinux2014_x86_64
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v1
|
||||
|
||||
- name: Install poetry
|
||||
run: |
|
||||
|
|
@ -201,11 +205,15 @@ jobs:
|
|||
- name: List contents of dist
|
||||
run: ls -R dist
|
||||
|
||||
- name: Get the name of the wheel file
|
||||
id: get-wheel-name
|
||||
run: echo "::set-output name=wheel-name::$(ls dist/*.whl)"
|
||||
|
||||
- name: Archive build artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v1
|
||||
with:
|
||||
name: dist-artifacts-manylinux-${{ matrix.python }}
|
||||
path: dist/*
|
||||
path: ${{ steps.get-wheel-name.outputs.wheel-name }}
|
||||
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
|
|
|
|||
|
|
@ -2,6 +2,11 @@
|
|||
|
||||
## Unreleased
|
||||
|
||||
## v1.13.2 (2024-07-21)
|
||||
* update string checks in initialization method for latent variable and put `empirical_samples` init-method on a deprecation path
|
||||
|
||||
* update dependencies to `numpy>=1.7.0,<2.0.0`
|
||||
|
||||
* update import in `.plotting.matplot_dep.defaults` due to change in matplotlib
|
||||
|
||||
* Correct dl_dm term in student t inference #1065
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
__version__ = "1.13.1"
|
||||
__version__ = "1.13.2"
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -1,31 +1,59 @@
|
|||
'''
|
||||
"""
|
||||
Created on 24 Feb 2014
|
||||
|
||||
@author: maxz
|
||||
'''
|
||||
"""
|
||||
|
||||
import numpy as np
|
||||
import warnings
|
||||
from ..util.pca import PCA
|
||||
|
||||
|
||||
def initialize_latent(init, input_dim, Y):
|
||||
"""
|
||||
:param init: initialization method for the latent space, 'PCA' or 'random'
|
||||
"""
|
||||
Xr = np.asfortranarray(np.random.normal(0, 1, (Y.shape[0], input_dim)))
|
||||
if 'PCA' in init:
|
||||
if "PCA" == init:
|
||||
p = PCA(Y)
|
||||
PC = p.project(Y, min(input_dim, Y.shape[1]))
|
||||
Xr[:PC.shape[0], :PC.shape[1]] = PC
|
||||
var = .1*p.fracs[:input_dim]
|
||||
elif init in 'empirical_samples':
|
||||
Xr[: PC.shape[0], : PC.shape[1]] = PC
|
||||
var = 0.1 * p.fracs[:input_dim]
|
||||
elif init == "empirical_samples":
|
||||
# dealing with depcrecated initialization method
|
||||
# should be remove along the next major release
|
||||
warnings.warn(
|
||||
"Deprecated initialization method 'empirical_samples'. "
|
||||
"Use 'random' instead.",
|
||||
DeprecationWarning,
|
||||
)
|
||||
|
||||
from ..util.linalg import tdot
|
||||
from ..util import diag
|
||||
|
||||
YYT = tdot(Y)
|
||||
diag.add(YYT, 1e-6)
|
||||
EMP = np.asfortranarray(np.random.multivariate_normal(np.zeros(Y.shape[0]), YYT, min(input_dim, Y.shape[1])).T)
|
||||
Xr[:EMP.shape[0], :EMP.shape[1]] = EMP
|
||||
EMP = np.asfortranarray(
|
||||
np.random.multivariate_normal(
|
||||
np.zeros(Y.shape[0]), YYT, min(input_dim, Y.shape[1])
|
||||
).T
|
||||
)
|
||||
Xr[: EMP.shape[0], : EMP.shape[1]] = EMP
|
||||
var = np.random.uniform(0.5, 1.5, input_dim)
|
||||
else:
|
||||
elif init == "random":
|
||||
var = Xr.var(0)
|
||||
else:
|
||||
# dealing with depcrecated initialization method
|
||||
# should be remove along the next major release
|
||||
warnings.warn(
|
||||
f"{init} is not a valid initialization method."
|
||||
"Supoprt for anything else than 'PCA' or 'random' will be removed in the next major release.",
|
||||
DeprecationWarning,
|
||||
)
|
||||
var = Xr.var(0)
|
||||
|
||||
|
||||
Xr -= Xr.mean(0)
|
||||
Xr /= Xr.std(0)
|
||||
|
||||
return Xr, var/var.max()
|
||||
return Xr, var / var.max()
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
[bumpversion]
|
||||
current_version = 1.13.1
|
||||
current_version = 1.13.2
|
||||
tag = True
|
||||
commit = True
|
||||
|
||||
|
|
|
|||
4
setup.py
4
setup.py
|
|
@ -140,7 +140,7 @@ except ModuleNotFoundError:
|
|||
ext_mods = []
|
||||
|
||||
install_requirements = [
|
||||
"numpy>=1.7",
|
||||
"numpy>=1.7,<2.0.0",
|
||||
"six",
|
||||
"paramz>=0.9.6",
|
||||
"cython>=0.29",
|
||||
|
|
@ -197,7 +197,7 @@ setup(
|
|||
include_package_data=True,
|
||||
py_modules=["GPy.__init__"],
|
||||
test_suite="GPy.testing",
|
||||
setup_requires=["numpy>=1.7"],
|
||||
setup_requires=["numpy>=1.7,<2.0.0"],
|
||||
install_requires=install_requirements,
|
||||
extras_require={
|
||||
"docs": ["sphinx"],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue