Comments (1)
Yeah this is a slightly fiddly one, my approach so far is just to focus on what happens once you have created the arrays, with the random functions included so far mostly just for testing purposes. Jax already handles random numbers pretty differently.
Having said that having a guaranteed interface for being able to call (as a first draft of things I too would find useful):
random.normal
/random.uniform
eye
/identity
zeros
ones
with dtype specified would be useful in and of itself, as well as for writing lots of algorithms which aren't 'creating arrays' as their overall purpose - e.g. randomized SVD etc.
Happy to accept any PRs along this direction. Some general thoughts:
- I think supporting the more concise
do('random.normal', ...)
style calls would be simplest to begin with, even ifnumpy.random.Generator
is used in the background. - Unless they are exceptionally easy to add I'm tempted to leave out stuff like
binomial
until someones needs them. - I think it would make sense to default to
dtype=None
with the backend deciding thedtype
since jax e.g. and other backends have goodish reasons for by default forcing everything to the same precision (hardware-acceleration) - in other words, dtype control probably should be opt-in with errors / loud warnings? when it can't be provided
from autoray.
Related Issues (8)
- autoray transpose attribute-like function fails for torch tensors HOT 3
- Interface and 'do' HOT 6
- numpy 1.24 deprecations fail quimb HOT 3
- How can I get this function from LazyArray HOT 6
- The shape of LazyArray HOT 7
- correctly infer backend for functions like concatenate HOT 3
- Translations and ideas for extensions HOT 4
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 autoray.