Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
seminar-breakout
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Shashank Suhas
seminar-breakout
Commits
fdad5c4f
You need to sign in or sign up before continuing.
Commit
fdad5c4f
authored
Jun 15, 2016
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update readme
parent
35c5a4e8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
13 deletions
+12
-13
README.md
README.md
+5
-1
examples/char-rnn/char-rnn.py
examples/char-rnn/char-rnn.py
+4
-10
tensorpack/utils/utils.py
tensorpack/utils/utils.py
+3
-2
No files found.
README.md
View file @
fdad5c4f
...
@@ -3,7 +3,11 @@ Neural Network Toolbox on TensorFlow
...
@@ -3,7 +3,11 @@ Neural Network Toolbox on TensorFlow
In development but usable. API might change a bit.
In development but usable. API might change a bit.
See some interesting
[
examples
](
https://github.com/ppwwyyxx/tensorpack/tree/master/examples
)
to learn.
See some interesting
[
examples
](
https://github.com/ppwwyyxx/tensorpack/tree/master/examples
)
to learn about the framework:
+
[
Double-DQN for playing Atari games
](
https://github.com/ppwwyyxx/tensorpack/tree/master/examples/Atari2600
)
+
[
ResNet for Cifar10 classification
](
https://github.com/ppwwyyxx/tensorpack/tree/master/examples/ResNet
)
+
[
char-rnn language model
](
https://github.com/ppwwyyxx/tensorpack/tree/master/examples/char-rnn
)
## Features:
## Features:
...
...
examples/char-rnn/char-rnn.py
View file @
fdad5c4f
...
@@ -13,11 +13,8 @@ import six
...
@@ -13,11 +13,8 @@ import six
from
six.moves
import
map
,
range
from
six.moves
import
map
,
range
from
tensorpack
import
*
from
tensorpack
import
*
from
tensorpack.models
import
*
from
tensorpack.utils
import
*
from
tensorpack.tfutils.gradproc
import
*
from
tensorpack.tfutils.gradproc
import
*
from
tensorpack.utils.lut
import
LookUpTable
from
tensorpack.utils.lut
import
LookUpTable
from
tensorpack.callbacks
import
*
from
tensorflow.python.ops
import
rnn_cell
from
tensorflow.python.ops
import
rnn_cell
from
tensorflow.python.ops
import
rnn
from
tensorflow.python.ops
import
rnn
...
@@ -190,8 +187,6 @@ if __name__ == '__main__':
...
@@ -190,8 +187,6 @@ if __name__ == '__main__':
args
=
parser
.
parse_args
()
args
=
parser
.
parse_args
()
if
args
.
gpu
:
if
args
.
gpu
:
os
.
environ
[
'CUDA_VISIBLE_DEVICES'
]
=
args
.
gpu
os
.
environ
[
'CUDA_VISIBLE_DEVICES'
]
=
args
.
gpu
else
:
os
.
environ
[
'CUDA_VISIBLE_DEVICES'
]
=
'0'
if
args
.
command
==
'sample'
:
if
args
.
command
==
'sample'
:
param
.
softmax_temprature
=
args
.
temperature
param
.
softmax_temprature
=
args
.
temperature
...
@@ -199,9 +194,8 @@ if __name__ == '__main__':
...
@@ -199,9 +194,8 @@ if __name__ == '__main__':
sample
(
args
.
load
,
args
.
start
,
args
.
num
)
sample
(
args
.
load
,
args
.
start
,
args
.
num
)
sys
.
exit
()
sys
.
exit
()
else
:
else
:
with
tf
.
Graph
()
.
as_default
():
config
=
get_config
()
config
=
get_config
()
if
args
.
load
:
if
args
.
load
:
config
.
session_init
=
SaverRestore
(
args
.
load
)
config
.
session_init
=
SaverRestore
(
args
.
load
)
QueueInputTrainer
(
config
)
.
train
()
QueueInputTrainer
(
config
)
.
train
()
tensorpack/utils/utils.py
View file @
fdad5c4f
...
@@ -70,8 +70,9 @@ class memoized(object):
...
@@ -70,8 +70,9 @@ class memoized(object):
'''Support instance methods.'''
'''Support instance methods.'''
return
functools
.
partial
(
self
.
__call__
,
obj
)
return
functools
.
partial
(
self
.
__call__
,
obj
)
def
get_rng
(
self
):
def
get_rng
(
obj
=
None
):
seed
=
(
id
(
self
)
+
os
.
getpid
()
+
""" obj: some object to use to generate random seed"""
seed
=
(
id
(
obj
)
+
os
.
getpid
()
+
int
(
datetime
.
now
()
.
strftime
(
"
%
Y
%
m
%
d
%
H
%
M
%
S
%
f"
)))
%
4294967295
int
(
datetime
.
now
()
.
strftime
(
"
%
Y
%
m
%
d
%
H
%
M
%
S
%
f"
)))
%
4294967295
return
np
.
random
.
RandomState
(
seed
)
return
np
.
random
.
RandomState
(
seed
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment