Comments (4)
but it would literally just be another name for what
StanRNG
already does, same arguments and all.
Yeah, I went with this different style in Julia due to this and the more general fact that Julia doesn't let you directly associate methods with a struct the way Python and R's classes do. I think we could literally write new_rng = StanRNG
in the Julia file and it would be equivalent.
In R and Python, the constructor of the StanRNG
is internal/not documented online because it is written such that it takes in the handle to the library directly, rather than a handle to the model.
We sweep this distinction under the rug for the user, but creating an RNG doesn't really require anything from the model instance, but it does require accessing the library the model came from.
from bridgestan.
In R and Python, the constructor of the StanRNG is internal/not documented online because it is written such that it takes in the handle to the library directly, rather than a handle to the model.
Right. Would it be better to have
class StanRNG:
def __init__(self, sm: StanModel, seed: int) -> None:
self.stanlib = sm.stanlib
...
and equivalent in R, since this is effectively what happens in Julia?
from bridgestan.
I think I'd rather keep those as they were and add the new_rng
alias to the Julia interface if method-for-method parity is the goal
from bridgestan.
To avoid potential confusion, I suggest not using an alias and instead defining
new_rng(sm::StanModel, seed) = StanRNG(sm, seed)
This is similar to how Random defines default_rng([tid])
: https://github.com/JuliaLang/julia/blob/e204e200df8f57e516920c056b6ec2eb37d34079/stdlib/Random/src/RNGs.jl#L346-L347
from bridgestan.
Related Issues (20)
- Missing support for precompiled header HOT 25
- Tracking: Changes in the next version of Stan
- Better Error Message for Python Interface Automatically Downloading BridgeStan Source HOT 1
- bridgestan on Julia crashes on windows if .julia path has spaces HOT 5
- clang argument error during model compile on MacOS HOT 14
- Functionality necessary to nest Stan models in other PPLs HOT 13
- Tracking: Changes in Stan 2.34
- More consistent instantiation from a .stan file in various languages HOT 2
- Python callback into BridgeStan with C types HOT 10
- Control over the internal threading of a model
- logo icons HOT 2
- Add an R function to convert data list to JSON HOT 2
- github.io page outdated HOT 1
- Tracking: Changes in the next version of Stan
- clang: error: no such file or directory: './stan/lib/stan_math/lib/tbb/libtbb.dylib' HOT 3
- add no_warnings / quiet option to StanModel$new() HOT 10
- any way to reduce UserWarning level on loading already loaded model? HOT 3
- Ability to check if bridgestan sources are already available HOT 9
- Consider moving Julia download away from LazyArtifacts HOT 5
- Bridgestan failure with Hessian AD enabled HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bridgestan.