mirror of
https://github.com/apachecn/ailearning.git
synced 2026-05-03 10:01:56 +08:00
2020-10-19 21:08:55
This commit is contained in:
@@ -2,14 +2,14 @@
|
||||
|
||||
In [1]:
|
||||
|
||||
```
|
||||
```py
|
||||
import theano
|
||||
import theano.tensor as T
|
||||
import numpy as np
|
||||
|
||||
```
|
||||
|
||||
```
|
||||
```py
|
||||
Using gpu device 1: Tesla C2075 (CNMeM is disabled)
|
||||
|
||||
```
|
||||
@@ -18,7 +18,7 @@ Using gpu device 1: Tesla C2075 (CNMeM is disabled)
|
||||
|
||||
In [2]:
|
||||
|
||||
```
|
||||
```py
|
||||
from theano.sandbox.rng_mrg import MRG_RandomStreams
|
||||
|
||||
```
|
||||
@@ -27,7 +27,7 @@ from theano.sandbox.rng_mrg import MRG_RandomStreams
|
||||
|
||||
In [3]:
|
||||
|
||||
```
|
||||
```py
|
||||
srng = MRG_RandomStreams()
|
||||
|
||||
```
|
||||
@@ -47,7 +47,7 @@ srng = MRG_RandomStreams()
|
||||
|
||||
In [4]:
|
||||
|
||||
```
|
||||
```py
|
||||
rand_size = T.vector(dtype="int64")
|
||||
|
||||
rand_normal = srng.normal(rand_size.shape)
|
||||
@@ -63,7 +63,7 @@ print f_rand(range(5))[2]
|
||||
|
||||
```
|
||||
|
||||
```
|
||||
```py
|
||||
[ 0.10108768 -1.64354193 0.71042836 -0.77760422 0.06291872]
|
||||
[ 0.23193923 0.71880513 0.03122572 0.97318739 0.99260223]
|
||||
[0 1 0 1 1]
|
||||
|
||||
Reference in New Issue
Block a user