Giter Club home page Giter Club logo

greta.gp's People

Contributors

goldingn avatar jdyen avatar njtierney avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

greta.gp's Issues

catch incorrect length of lengthscale vector

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

Cannot run example code from repo: [AttributeError: Unknown setting; coming from dag$define_tf()]

Issue

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

Version Informations:

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?

Cannot run example code from repo: Error in py_set_attr_impl(x, name, value) : ValueError: Value has different shape. Parameter shape (1,), value shape (1, 1).

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)

switch to version not using GPflow

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.

Release greta.gp 0.2.0

Updating to current toolchain

  • use github actions
  • tidy up description
  • use markdown roxygen
  • use cli for messages
  • tidy up README
  • create basic vignette
  • use pkgdown
  • use snapshot tests where appropriate

First release:

Prepare for release:

  • git pull
  • Check if any deprecation processes should be advanced, as described in Gradual deprecation
  • devtools::build_readme()
  • urlchecker::url_check()
  • devtools::check(remote = TRUE, manual = TRUE)
  • devtools::check_win_devel()
  • rhub::check_for_cran()
  • git push
  • Draft blog post

Submit to CRAN:

  • usethis::use_version('minor')
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted ๐ŸŽ‰
  • git push
  • usethis::use_github_release()
  • usethis::use_dev_version()
  • usethis::use_news_md()
  • git push
  • Finish blog post
  • Tweet
  • Add link to blog post in pkgdown news menu

Fix package alias

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.

Cannot run example code (from this git or jdyen 0.3.0.x one)

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.