Hi
user
Admin Login:
Username:
Password:
Name:
Fast random number generation in Python and NumPy
--client
pyconza
--show
pyconza2018
--room cedarwood 14367 --force
Next: 11 Parallel Programming with (Py)OpenCL for Fun and Profit
show more...
Marks
Author(s):
Bernardt Duvenhage
Location
Cedarwood
Date
oct Fri 12
Days Raw Files
Start
13:30
First Raw Start
13:01
Duration
00:55:00
Offset
0:28:58
End
14:25
Last Raw End
14:31
Chapters
00:00
0:00:03
0:21:49
Total cuts_time
39 min.
https://za.pycon.org/talks/53-fast-random-number-generation-in-python-and-numpy/
raw-playlist
raw-mp4-playlist
encoded-files-playlist
host
archive
tweet
mp4
svg
png
assets
release.pdf
An_introduction_to_concurrent_programming_with_asyncio.json
logs
Admin:
episode
episode list
cut list
raw files day
marks day
marks day
image_files
State:
---------
borked
edit
encode
push to queue
post
richard
review 1
email
review 2
make public
tweet
to-miror
conf
done
Locked:
clear this to unlock
Locked by:
user/process that locked.
Start:
initially scheduled time from master, adjusted to match reality
Duration:
length in hh:mm:ss
Name:
Video Title (shows in video search results)
Emails:
email(s) of the presenter(s)
Released:
has someone authorised pubication
Unknown
Yes
No
Normalise:
Channelcopy:
m=mono, 01=copy left to right, 10=right to left, 00=ignore.
Thumbnail:
filename.png
Description:
markdown
A fast Random Number Generator (RNG) is key to doing Monte Carlo simulations, efficiently initialising machine learning models, shuffling long sequences of numbers and many tasks in scientific computing. CPython and NumPy use implementations of the Mersenne Twister RNG and rejection sampling to generate random numbers in an interval. The NumPy implementation trades more samples for cheaper division by a power of two. The implementation is very efficient when the random interval is a power of two, but on average generate many more samples compared to the GNU C or Java algorithms. The Python RNG uses an algorithm similar to GNU C. A recent paper by Daniel Lemire (https://arxiv.org/abs/1805.10941) discusses an efficient division light method to generate uniform random numbers in an interval. This method is apparently used in the Go language. On 64-bit platforms there are also fast alternative RNGs that perform comparatively on statistical examinations passing tests like BigCrush. The splitmix64 (part of the standard Java API) and lehmer64 RNGs, for example, require approximately 1.5 cycles to generate 32 random bits (without using SIMD) while the 32-bit Mersenne Twister requires approximately 10 cycles per 32 bits. This talk will discuss the inclusion of Lemire's method in NumPy as an alternative to the current rejection sampling implementation. My implementation results in a 2x - 3x improvement in the performance of generating a sequence of random numbers. Using splitmix64 or lehmer64 RNGs in NumPy instead of the Mersenne Twister results in a further 2x performance improvement. The random module in Python does not do the rejection sampling in C like NumPy does. Much of the time to get a random number is therefore spent in the Python code. This talk will also discuss a fast random Python module that implements Lemire's method instead of the current rejection sampling, provides alternative RNGs and moves more of the code into C. I'm considering doing pull requests for both the NumPy modification and the Python fast random module and will present a detailed analysis of the proposed modifications.
Comment:
production notes
2018-10-12/13_01_02.ts
Apply:
13:01:02 - 13:31:01 ( 00:29:59 )
S:
13:01:02 -
E:
13:31:01
D:
00:29:59
show more...
vlc ~/Videos/veyepar/pyconza/pyconza2018/dv/cedarwood/2018-10-12/13_01_02.ts :start-time=00.0 --audio-desync=0
Raw File
Cut List
13:01:02
seconds: 0.0
Wall: 13:01:02
Duration
00:29:59
13:31:01
seconds: 0.0
Wall: 13:01:02
Comments:
mp4
mp4.m3u
dv.m3u
Split:
Sequence:
:
delete
2018-10-12/13_31_02.ts
Apply:
13:31:02 - 13:34:47 ( 00:03:45 )
S:
13:31:02 -
E:
14:01:02
D:
00:30:00
(
End:
225.0)
show more...
vlc ~/Videos/veyepar/pyconza/pyconza2018/dv/cedarwood/2018-10-12/13_31_02.ts :start-time=00.0 --audio-desync=0
Raw File
Cut List
13:31:02
seconds: 0.0
Wall: 13:31:02
Duration
00:30:00
14:01:02
seconds: 225.0
Wall: 13:34:47
Comments:
mp4
mp4.m3u
dv.m3u
Split:
Sequence:
:
delete
2018-10-12/13_31_02.ts
Apply:
13:34:47 - 13:37:48 ( 00:03:01 )
S:
13:31:02 -
E:
14:01:02
D:
00:30:00
(
Start:
225.0) (
End:
406.0)
show more...
vlc ~/Videos/veyepar/pyconza/pyconza2018/dv/cedarwood/2018-10-12/13_31_02.ts :start-time=0225.0 --audio-desync=0
Raw File
Cut List
13:31:02
seconds: 225.0
Wall: 13:34:47
Duration
00:30:00
14:01:02
seconds: 406.0
Wall: 13:37:48
Comments:
mp4
mp4.m3u
dv.m3u
Split:
Sequence:
:
delete
2018-10-12/13_31_02.ts
Apply:
13:37:48 - 13:38:55 ( 00:01:07 )
S:
13:31:02 -
E:
14:01:02
D:
00:30:00
(
Start:
406.0) (
End:
473.0)
show more...
vlc ~/Videos/veyepar/pyconza/pyconza2018/dv/cedarwood/2018-10-12/13_31_02.ts :start-time=0406.0 --audio-desync=0
Raw File
Cut List
13:31:02
seconds: 406.0
Wall: 13:37:48
Duration
00:30:00
14:01:02
seconds: 473.0
Wall: 13:38:55
Comments:
mp4
mp4.m3u
dv.m3u
Split:
Sequence:
:
delete
2018-10-12/13_31_02.ts
Apply:
13:38:55 - 13:39:08 ( 00:00:13 )
S:
13:31:02 -
E:
14:01:02
D:
00:30:00
(
Start:
473.0) (
End:
486.0)
show more...
vlc ~/Videos/veyepar/pyconza/pyconza2018/dv/cedarwood/2018-10-12/13_31_02.ts :start-time=0473.0 --audio-desync=0
Raw File
Cut List
13:31:02
seconds: 473.0
Wall: 13:38:55
Duration
00:30:00
14:01:02
seconds: 486.0
Wall: 13:39:08
Comments:
mp4
mp4.m3u
dv.m3u
Split:
Sequence:
:
delete
2018-10-12/13_31_02.ts
Apply:
13:39:08 - 13:39:13 ( 00:00:05 )
S:
13:31:02 -
E:
14:01:02
D:
00:30:00
(
Start:
486.0) (
End:
491.0)
show more...
vlc ~/Videos/veyepar/pyconza/pyconza2018/dv/cedarwood/2018-10-12/13_31_02.ts :start-time=0486.0 --audio-desync=0
Raw File
Cut List
13:31:02
seconds: 486.0
Wall: 13:39:08
Duration
00:30:00
14:01:02
seconds: 491.0
Wall: 13:39:13
Comments:
mp4
mp4.m3u
dv.m3u
Split:
Sequence:
:
delete
2018-10-12/13_31_02.ts
Apply:
13:39:13 - 13:39:16 ( 00:00:03 )
S:
13:31:02 -
E:
14:01:02
D:
00:30:00
(
Start:
491.0) (
End:
494.0)
show more...
vlc ~/Videos/veyepar/pyconza/pyconza2018/dv/cedarwood/2018-10-12/13_31_02.ts :start-time=0491.0 --audio-desync=0
Raw File
Cut List
13:31:02
seconds: 491.0
Wall: 13:39:13
Duration
00:30:00
14:01:02
seconds: 494.0
Wall: 13:39:16
Comments:
mp4
mp4.m3u
dv.m3u
Split:
Sequence:
:
delete
2018-10-12/13_31_02.ts
Apply:
13:39:16 - 14:01:02 ( 00:21:46 )
S:
13:31:02 -
E:
14:01:02
D:
00:30:00
(
Start:
494.0)
show more...
vlc ~/Videos/veyepar/pyconza/pyconza2018/dv/cedarwood/2018-10-12/13_31_02.ts :start-time=0494.0 --audio-desync=0
Raw File
Cut List
13:31:02
seconds: 494.0
Wall: 13:39:16
Duration
00:30:00
14:01:02
seconds: 0.0
Wall: 13:31:02
Comments:
mp4
mp4.m3u
dv.m3u
Split:
Sequence:
:
delete
2018-10-12/14_01_02.ts
Apply:
14:01:02 - 14:18:41 ( 00:17:39 )
S:
14:01:02 -
E:
14:31:01
D:
00:29:59
(
End:
1059.0)
show more...
vlc ~/Videos/veyepar/pyconza/pyconza2018/dv/cedarwood/2018-10-12/14_01_02.ts :start-time=00.0 --audio-desync=0
Raw File
Cut List
14:01:02
seconds: 0.0
Wall: 14:01:02
Duration
00:29:59
14:31:01
seconds: 1059.0
Wall: 14:18:41
Comments:
mp4
mp4.m3u
dv.m3u
Split:
Sequence:
:
delete
2018-10-12/14_01_02.ts
Apply:
14:18:41 - 14:24:51 ( 00:06:10 )
S:
14:01:02 -
E:
14:31:01
D:
00:29:59
(
Start:
1059.0) (
End:
1429.0)
show more...
vlc ~/Videos/veyepar/pyconza/pyconza2018/dv/cedarwood/2018-10-12/14_01_02.ts :start-time=01059.0 --audio-desync=0
Raw File
Cut List
14:01:02
seconds: 1059.0
Wall: 14:18:41
Duration
00:29:59
14:31:01
seconds: 1429.0
Wall: 14:24:51
Comments:
mp4
mp4.m3u
dv.m3u
Split:
Sequence:
:
delete
2018-10-12/14_01_02.ts
Apply:
14:24:51 - 14:31:01 ( 00:06:10 )
S:
14:01:02 -
E:
14:31:01
D:
00:29:59
(
Start:
1429.0)
show more...
vlc ~/Videos/veyepar/pyconza/pyconza2018/dv/cedarwood/2018-10-12/14_01_02.ts :start-time=01429.0 --audio-desync=0
Raw File
Cut List
14:01:02
seconds: 1429.0
Wall: 14:24:51
Duration
00:29:59
14:31:01
seconds: 0.0
Wall: 14:01:02
Comments:
mp4
mp4.m3u
dv.m3u
Split:
Sequence:
:
delete
Rf filename:
root is .../show/dv/location/, example: 2013-03-13/13:13:30.dv
Sequence:
get this:
check and save to add this
2018-10-12/13_01_02.ts
2018-10-12/13_31_02.ts
2018-10-12/14_01_02.ts
Veyepar
Video Eyeball Processor and Review