revrand icon indicating copy to clipboard operation
revrand copied to clipboard

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

Open dsteinberg opened this issue 8 years ago • 0 comments

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 avatar Jan 29 '17 02:01 dsteinberg