Skip to content

Commit 05ea0d7

Browse files
Sheppard, KevinSheppard, Kevin
authored andcommitted
DOC: Update README
Improve README Add current timings
1 parent 258d5bc commit 05ea0d7

File tree

3 files changed

+61
-60
lines changed

3 files changed

+61
-60
lines changed

README.md

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ in Python and Numpy.
88

99
Features
1010

11-
* Immediate drop in replacement for Numy's RandomState
11+
* Immediate drop in replacement for NumPy's RandomState
1212

1313
```python
1414
# import numpy.random as rnd
@@ -22,7 +22,7 @@ z = rnd.randn(10,10)
2222
seed, same random numbers).
2323
* Support for random number generators that support independent streams and
2424
jumping ahead so that substreams can be generated
25-
* Faster ranomd number generations, especially for Normals using the Ziggurat
25+
* Faster random number generations, especially for Normals using the Ziggurat
2626
method
2727

2828
```python
@@ -44,14 +44,14 @@ version of the MT19937 generator that is especially fast at generating doubles
4444
[xorshift1024*](http://xorshift.di.unimi.it/)
4545
* [PCG32](http://www.pcg-random.org/) and [PCG64](http:w//www.pcg-random.org/)
4646
* [MRG32K3A](http://simul.iro.umontreal.ca/rng)
47-
* A multiplicative lagged fibonacci generator (LFG(31, 1279, 861, *))
47+
* A multiplicative lagged fibonacci generator (LFG(63, 1279, 861, *))
4848

4949
## Differences from `numpy.random.RandomState`
5050

5151
### New Features
52-
* `stanard_normal`, `normal`, `randn` and `multivariate_normal` all support
53-
an additional `method` keyword argument which can be `inv` or `zig` where
54-
`inv` corresponds to the current method and `zig` uses tha much faster
52+
* `standard_normal`, `normal`, `randn` and `multivariate_normal` all support
53+
an additional `method` keyword argument which can be `bm` or `zig` where
54+
`bm` corresponds to the current method and `zig` uses the much faster
5555
(100%+) ziggurat method.
5656

5757
### New Functions
@@ -76,18 +76,18 @@ identical sequence of random numbers for a given seed.
7676
* Windows 32/64 bit (only tested on Python 2.7 and 3.5, but should work on 3.3/3.4)
7777

7878
## Version
79-
The version matched the latest verion of NumPy where
79+
The version matched the latest version of NumPy where
8080
`randomstate.prng.mt19937` passes all NumPy test.
8181

8282
## Documentation
8383

84-
A occasionally updated build of the documentation is available on
84+
An occasionally updated build of the documentation is available on
8585
[my github pages](http://bashtage.github.io/ng-numpy-randomstate/).
8686

8787
## Plans
8888
This module is essentially complete. There are a few rough edges that need to be smoothed.
8989

90-
* Stream support for MLFG and MRG32K3A
90+
* Stream support for MLFG
9191
* Creation of additional streams from a RandomState where supported (i.e.
9292
a `next_stream()` method)
9393

@@ -127,7 +127,7 @@ python setup.py install --no-sse2
127127
Either use a binary installer or if building from scratch using Python 3.5 and
128128
the free Visual Studio 2015 Community Edition. It can also be build using
129129
Microsoft Visual C++ Compiler for Python 2.7 and Python 2.7, although some
130-
modifications are needed to distutils to find the compiler.
130+
modifications are needed to `distutils` to find the compiler.
131131

132132
## Using
133133

@@ -164,25 +164,25 @@ Standard NCSA, plus sub licenses for components.
164164
Performance is promising, and even the mt19937 seems to be faster than NumPy's mt19937.
165165

166166
```
167-
Speed-up relative to NumPy (Slow Normals)
167+
Speed-up relative to NumPy (Box-Muller)
168168
************************************************************
169-
randomstate.prng-dsfmt-standard_normal 107.2%
170-
randomstate.prng-mlfg_1279_861-standard_normal 51.2%
171-
randomstate.prng-mrg32k3a-standard_normal -11.8%
172-
randomstate.prng-mt19937-standard_normal 44.0%
173-
randomstate.prng-pcg32-standard_normal 51.2%
174-
randomstate.prng-pcg64-standard_normal 51.1%
175-
randomstate.prng-xorshift1024-standard_normal 50.5%
176-
randomstate.prng-xorshift128-standard_normal 52.1%
177-
178-
Speed-up relative to NumPy (Ziggural Normals)
169+
randomstate.prng-dsfmt-standard_normal 70.5%
170+
randomstate.prng-mlfg_1279_861-standard_normal 26.9%
171+
randomstate.prng-mrg32k3a-standard_normal -18.7%
172+
randomstate.prng-mt19937-standard_normal 13.5%
173+
randomstate.prng-pcg32-standard_normal 26.1%
174+
randomstate.prng-pcg64-standard_normal 26.2%
175+
randomstate.prng-xorshift1024-standard_normal 27.2%
176+
randomstate.prng-xorshift128-standard_normal 30.0%
177+
178+
Speed-up relative to NumPy (Ziggurat)
179179
************************************************************
180-
randomstate.prng-dsfmt-standard_normal 283.7%
181-
randomstate.prng-mlfg_1279_861-standard_normal 217.4%
182-
randomstate.prng-mrg32k3a-standard_normal 16.6%
183-
randomstate.prng-mt19937-standard_normal 201.3%
184-
randomstate.prng-pcg32-standard_normal 274.9%
185-
randomstate.prng-pcg64-standard_normal 310.8%
186-
randomstate.prng-xorshift1024-standard_normal 336.3%
187-
randomstate.prng-xorshift128-standard_normal 425.1%
180+
randomstate.prng-dsfmt-standard_normal 316.1%
181+
randomstate.prng-mlfg_1279_861-standard_normal 247.0%
182+
randomstate.prng-mrg32k3a-standard_normal 51.2%
183+
randomstate.prng-mt19937-standard_normal 175.9%
184+
randomstate.prng-pcg32-standard_normal 255.9%
185+
randomstate.prng-pcg64-standard_normal 329.1%
186+
randomstate.prng-xorshift1024-standard_normal 362.0%
187+
randomstate.prng-xorshift128-standard_normal 513.7%
188188
```

README.rst

Lines changed: 31 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ generators in Python and Numpy.
88

99
Features
1010

11-
- Immediate drop in replacement for Numy's RandomState
11+
- Immediate drop in replacement for NumPy's RandomState
1212

1313
.. code:: python
1414
@@ -22,7 +22,7 @@ Features
2222
same seed, same random numbers).
2323
- Support for random number generators that support independent streams
2424
and jumping ahead so that substreams can be generated
25-
- Faster ranomd number generations, especially for Normals using the
25+
- Faster random number generations, especially for Normals using the
2626
Ziggurat method
2727

2828
.. code:: python
@@ -46,18 +46,19 @@ in addition to the MT19937 that is included in NumPy. The RNGs include:
4646
- `PCG32 <http://www.pcg-random.org/>`__ and
4747
`PCG64 <http:w//www.pcg-random.org/>`__
4848
- `MRG32K3A <http://simul.iro.umontreal.ca/rng>`__
49-
- A multiplicative lagged fibonacci generator (LFG(31, 1279, 861, \*))
49+
- A multiplicative lagged fibonacci generator (LFG(63, 1279, 861, \*))
5050

5151
Differences from ``numpy.random.RandomState``
5252
---------------------------------------------
5353

5454
New Features
5555
~~~~~~~~~~~~
5656

57-
- ``stanard_normal``, ``normal``, ``randn`` and ``multivariate_normal``
58-
all support an additional ``method`` keyword argument which can be
59-
``inv`` or ``zig`` where ``inv`` corresponds to the current method
60-
and ``zig`` uses tha much faster (100%+) ziggurat method.
57+
- ``standard_normal``, ``normal``, ``randn`` and
58+
``multivariate_normal`` all support an additional ``method`` keyword
59+
argument which can be ``bm`` or ``zig`` where ``bm`` corresponds to
60+
the current method and ``zig`` uses the much faster (100%+) ziggurat
61+
method.
6162

6263
New Functions
6364
~~~~~~~~~~~~~
@@ -88,13 +89,13 @@ Status
8889
Version
8990
-------
9091

91-
The version matched the latest verion of NumPy where
92+
The version matched the latest version of NumPy where
9293
``randomstate.prng.mt19937`` passes all NumPy test.
9394

9495
Documentation
9596
-------------
9697

97-
A occasionally updated build of the documentation is available on `my
98+
An occasionally updated build of the documentation is available on `my
9899
github pages <http://bashtage.github.io/ng-numpy-randomstate/>`__.
99100

100101
Plans
@@ -103,7 +104,7 @@ Plans
103104
This module is essentially complete. There are a few rough edges that
104105
need to be smoothed.
105106

106-
- Stream support for MLFG and MRG32K3A
107+
- Stream support for MLFG
107108
- Creation of additional streams from a RandomState where supported
108109
(i.e. a ``next_stream()`` method)
109110

@@ -151,7 +152,7 @@ Windows
151152
Either use a binary installer or if building from scratch using Python
152153
3.5 and the free Visual Studio 2015 Community Edition. It can also be
153154
build using Microsoft Visual C++ Compiler for Python 2.7 and Python 2.7,
154-
although some modifications are needed to distutils to find the
155+
although some modifications are needed to ``distutils`` to find the
155156
compiler.
156157

157158
Using
@@ -196,27 +197,27 @@ NumPy's mt19937.
196197

197198
::
198199

199-
Speed-up relative to NumPy (Slow Normals)
200+
Speed-up relative to NumPy (Box-Muller)
200201
************************************************************
201-
randomstate.prng-dsfmt-standard_normal 107.2%
202-
randomstate.prng-mlfg_1279_861-standard_normal 51.2%
203-
randomstate.prng-mrg32k3a-standard_normal -11.8%
204-
randomstate.prng-mt19937-standard_normal 44.0%
205-
randomstate.prng-pcg32-standard_normal 51.2%
206-
randomstate.prng-pcg64-standard_normal 51.1%
207-
randomstate.prng-xorshift1024-standard_normal 50.5%
208-
randomstate.prng-xorshift128-standard_normal 52.1%
209-
210-
Speed-up relative to NumPy (Ziggural Normals)
202+
randomstate.prng-dsfmt-standard_normal 70.5%
203+
randomstate.prng-mlfg_1279_861-standard_normal 26.9%
204+
randomstate.prng-mrg32k3a-standard_normal -18.7%
205+
randomstate.prng-mt19937-standard_normal 13.5%
206+
randomstate.prng-pcg32-standard_normal 26.1%
207+
randomstate.prng-pcg64-standard_normal 26.2%
208+
randomstate.prng-xorshift1024-standard_normal 27.2%
209+
randomstate.prng-xorshift128-standard_normal 30.0%
210+
211+
Speed-up relative to NumPy (Ziggurat)
211212
************************************************************
212-
randomstate.prng-dsfmt-standard_normal 283.7%
213-
randomstate.prng-mlfg_1279_861-standard_normal 217.4%
214-
randomstate.prng-mrg32k3a-standard_normal 16.6%
215-
randomstate.prng-mt19937-standard_normal 201.3%
216-
randomstate.prng-pcg32-standard_normal 274.9%
217-
randomstate.prng-pcg64-standard_normal 310.8%
218-
randomstate.prng-xorshift1024-standard_normal 336.3%
219-
randomstate.prng-xorshift128-standard_normal 425.1%
213+
randomstate.prng-dsfmt-standard_normal 316.1%
214+
randomstate.prng-mlfg_1279_861-standard_normal 247.0%
215+
randomstate.prng-mrg32k3a-standard_normal 51.2%
216+
randomstate.prng-mt19937-standard_normal 175.9%
217+
randomstate.prng-pcg32-standard_normal 255.9%
218+
randomstate.prng-pcg64-standard_normal 329.1%
219+
randomstate.prng-xorshift1024-standard_normal 362.0%
220+
randomstate.prng-xorshift128-standard_normal 513.7%
220221

221222
.. |Travis Build Status| image:: https://travis-ci.org/bashtage/ng-numpy-randomstate.svg?branch=master
222223
:target: https://travis-ci.org/bashtage/ng-numpy-randomstate

randomstate/performance.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def timer_normal():
8888
command = 'rs.{dist}(1000000, method="bm")'
8989
command_numpy = 'rs.{dist}(1000000)'
9090
dist = 'standard_normal'
91-
run_timer(dist, command, command_numpy, SETUP, 'Standard normals')
91+
run_timer(dist, command, command_numpy, SETUP, 'Box-Muller normals')
9292

9393

9494
def timer_normal_zig():

0 commit comments

Comments
 (0)