greta-dev / greta.gp Goto Github PK
View Code? Open in Web Editor NEWa greta extension for Gaussian process modelling
Home Page: https://greta-dev.github.io/greta.gp/
License: Apache License 2.0
a greta extension for Gaussian process modelling
Home Page: https://greta-dev.github.io/greta.gp/
License: Apache License 2.0
When a kernel is specified with a single lengthscale, but evaluated on a design matrix with multiple columns, only the first column is used and no warning is issued. We should let the user know about a dimension mismatch, and either error, or in the case of a single lengthscale bing provided, just replicate it and assume they want an isotropic kernel.
See here for a reprex: https://forum.greta-stats.org/t/gaussian-process-in-greta-matern-covariance/151/17
I can't seem to be able to run the example in the repo's README, with the following error when I try to create the model object.
> m <- model(f_plot)
Error in py_call_impl(callable, dots$args, dots$keywords) :
AttributeError: Unknown setting.
Detailed traceback:
File "/opt/conda/lib/python3.6/site-packages/gpflow-1.1.0-py3.6.egg/gpflow/core/compilable.py", line 91, in __init__
self.initialize(force=True)
File "/opt/conda/lib/python3.6/site-packages/gpflow-1.1.0-py3.6.egg/gpflow/core/node.py", line 77, in initialize
session = self.enquire_session(session)
File "/opt/conda/lib/python3.6/site-packages/gpflow-1.1.0-py3.6.egg/gpflow/core/node.py", line 127, in enquire_session
session = session_manager.get_default_session()
File "/opt/conda/lib/python3.6/site-packages/gpflow-1.1.0-py3.6.egg/gpflow/session_manager.py", line 95, in get_default_session
_DefaultSessionKeeper.session = get_session(*args, **kwargs)
File "/opt/conda/lib/python3.6/site-packages/gpflow-1.1.0-py3.6.egg/gpflow/session_manager.py", line 104, in get_session
kwargs['config'] = tf.ConfigProto(**settings.session)
File "/opt/conda/lib/python3.6/site-packages/gpflow-1.1.0-py3.6.egg/gpflow
gpflow: 1.1.0 (installed from the gpflow repo)
tensorflow: 1.6.0 (PyPI pip install)
greta.gp: 0.1.3
greta: 0.2.4
I can run examples from gpflow's documentations, so I think my gpflow installation should be good.. Any thoughts?
I begin the example code somewhat differently as follows:
library(reticulate)
gpflow <- import("gpflow") # to verify that gpflow can be found by reticulate
# also, without the above, I get
# "Error: the GPflow python package and the gpflowr R package must be installed to plot greta models"
library(gpflowr)
library (greta)
library (greta.gp)
Then when the example code reaches the following line, an error is reported:
m <- model(f_plot)
Error in py_set_attr_impl(x, name, value) : ValueError: Value has different shape. Parameter shape (1,), value shape (1, 1).
40. stop(structure(list(message = "ValueError: Value has different shape. Parameter shape (1,), value shape (1, 1).", call = py_set_attr_impl(x, name, value), cppstack = structure(list( file = "", line = -1L, stack = "C++ stack not available on this system"), .Names = c("file", "line", "stack"), class = "Rcpp_stack_trace")), .Names = c("message", ...
39. py_set_attr_impl(x, name, value)
38. py_set_attr(x, name, value)
37. `[[<-.python.builtin.object`(`*tmp*`, name, value = <environment>)
36. `[[<-`(`*tmp*`, name, value = <environment>)
35. recurse_kernel(greta_kernel$components[[1]], tf_parameters, counter)
34. recurse_kernel(greta_kernel, tf_parameters, counter)
33. compile_gpflow_kernel(greta_kernel, tf_parameters)
32. (function (X, ..., greta_kernel) { tf_parameters <- list(...) gpflow_kernel <- compile_gpflow_kernel(greta_kernel, tf_parameters) ...
31. do.call(self$operation, args)
30. self$tf(dag)
29. x$define_tf(dag)
28. FUN(X[[i]], ...)
27. lapply(self$children[which(!children_defined)], function(x) x$define_tf(dag))
26. x$define_tf(dag)
25. FUN(X[[i]], ...)
24. lapply(self$children[which(!children_defined)], function(x) x$define_tf(dag))
23. x$define_tf(dag)
22. FUN(X[[i]], ...)
21. lapply(self$children[which(!children_defined)], function(x) x$define_tf(dag))
20. x$define_tf(dag)
19. FUN(X[[i]], ...)
18. lapply(self$children[which(!children_defined)], function(x) x$define_tf(dag))
17. x$define_tf(dag)
16. FUN(X[[i]], ...)
15. lapply(self$children[which(!children_defined)], function(x) x$define_tf(dag))
14. x$define_tf(dag)
13. FUN(X[[i]], ...)
12. lapply(self$children[which(!children_defined)], function(x) x$define_tf(dag))
11. x$define_tf(self)
10. FUN(X[[i]], ...)
9. lapply(self$node_list, function(x) x$define_tf(self))
8. force(expr)
7. tryCatchList(expr, classes, parentenv, handlers)
6. tryCatch(force(expr), finally = { data$`__exit__`(NULL, NULL, NULL) if (!is.null(as)) { remove(list = as, envir = envir) ...
5. with.python.builtin.object(self$tf_graph$as_default(), expr)
4. with(self$tf_graph$as_default(), expr)
3. self$on_graph(lapply(self$node_list, function(x) x$define_tf(self)))
2. dag$define_tf()
1. model(f_plot)
As GPflow is only being used for the kernel definitions, it can easily be ported to pure R/greta.
That would ease installation woes for R users and make it far easier to add more kernels.
Updating to current toolchain
cli
for messagesFirst release:
usethis::use_cran_comments()
Title:
and Description:
@return
and @examples
Authors@R:
includes a copyright holder (role 'cph')Prepare for release:
git pull
devtools::build_readme()
urlchecker::url_check()
devtools::check(remote = TRUE, manual = TRUE)
devtools::check_win_devel()
rhub::check_for_cran()
git push
Submit to CRAN:
usethis::use_version('minor')
devtools::submit_cran()
Wait for CRAN...
git push
usethis::use_github_release()
usethis::use_dev_version()
usethis::use_news_md()
git push
Dear maintainer,
You have file 'greta.gp/man/greta.gp.Rd' with \docType{package}, likely
intended as a package overview help file, but without the appropriate
PKGNAME-package \alias as per "Documenting packages" in R-exts.
This seems to be the consequence of the breaking change
Using @doctype package no longer automatically adds a -package alias.
Instead document _PACKAGE to get all the defaults for package
documentation.
in roxygen2 7.0.0 (2019-11-12) having gone unnoticed, see
r-lib/roxygen2#1491.
As explained in the issue, to get the desired PKGNAME-package \alias
back, you should either change to the new approach and document the new
special sentinel
"_PACKAGE"
or manually add
@aliases greta.gp-package
if remaining with the old approach.
e.g. Wiener process kernel (wanted for this model)
and ar1 process kernel (wanted for this model)
Hi.
Switching from JAGS to Greta and this extension is exactly what I was looking for. However, when I try to run the example code I get the following error:
f <- gp(x, kernel)
Error: objects of class function cannot be coerced to greta arrays
I thought it may be due to the fact that I have greta 0.3.0.9002 installed. So I tried jdyen's forked version and got a different error
m <- model(f_plot)
Error in tf$gather(X, dims, axis = -1L) : attempt to apply non-function
I tried to find solutions to similar R<->Tensorflow issues via google, but have been unable to make any progress.
I'm on Windows 10. Tensorflow 1.13.1 is set up to use my GPU in a virtual conda environment. I haven't had any issues running models in greta, just greta.gp.
Have you run into any of these issues?
Thanks so much
H
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.