Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make ARD length-scale bases return generator gradients instead of tensors #130

Open
dsteinberg opened this issue Jan 29, 2017 · 0 comments

Comments

@dsteinberg
Copy link
Contributor

dsteinberg commented Jan 29, 2017

Otherwise we get potentially massive memory usage, i.e. using the SLM on SARCOS, ARD on 21 dimensions uses too much memory.

Make these sorts of lines return generators, and fix apply_grad to work with them instead of 3-D arrays:

        for i, l in enumerate(lenscale):
            ldist = cdist(X[:, [i]] / l**3, self.C[:, [i]] / l**3,
                          'sqeuclidean')
            dPhi.append(Phi * ldist)

        return np.dstack(dPhi) if len(lenscale) != 1 else dPhi[0]

see https://github.com/NICTA/revrand/blob/master/revrand/basis_functions.py#L714

@dsteinberg dsteinberg added this to the Release 1.1 milestone Jan 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant