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
a36ad180
Commit
a36ad180
authored
Aug 16, 2017
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve TOC style and fix some documentations
parent
ce7e4892
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
21 additions
and
38 deletions
+21
-38
docs/_static/build_toc_group.js
docs/_static/build_toc_group.js
+3
-3
docs/modules/dataflow.rst
docs/modules/dataflow.rst
+0
-3
docs/modules/tfutils.rst
docs/modules/tfutils.rst
+6
-8
docs/modules/utils.rst
docs/modules/utils.rst
+0
-9
docs/requirements.txt
docs/requirements.txt
+1
-1
tensorpack/models/_test.py
tensorpack/models/_test.py
+2
-1
tensorpack/tfutils/distributions.py
tensorpack/tfutils/distributions.py
+2
-2
tensorpack/utils/argtools.py
tensorpack/utils/argtools.py
+1
-0
tensorpack/utils/logger.py
tensorpack/utils/logger.py
+6
-11
No files found.
docs/_static/build_toc_group.js
View file @
a36ad180
...
...
@@ -30,7 +30,7 @@ $(function (){
if
(
groupName
in
obj
)
{
obj
[
groupName
].
append
(
entry
);
}
else
{
var
ul
=
$
(
'
<ul>
'
);
var
ul
=
$
(
'
<ul
style="margin-bottom: 12px;"
>
'
);
ul
.
append
(
entry
);
obj
[
groupName
]
=
ul
;
}
...
...
@@ -50,9 +50,9 @@ $(function (){
return
;
var
obj
=
createList
(
selected
);
var
block
=
$
(
'
<div style="min-width: 300px;">
'
);
var
block
=
$
(
'
<div style="min-width: 300px;
margin-bottom: 2em;
">
'
);
for
(
var
key
in
obj
)
{
var
a
=
$
(
'
<h
5
>
'
);
var
a
=
$
(
'
<h
6 style="margin-bottom: 0;"
>
'
);
a
.
html
(
key
+
'
:
'
);
block
.
append
(
a
);
block
.
append
(
obj
[
key
]);
...
...
docs/modules/dataflow.rst
View file @
a36ad180
...
...
@@ -8,9 +8,6 @@ tensorpack.dataflow package
<script type="text/javascript" src='../_static/build_toc_group.js'></script>
DataFlow
---------------
.. automodule:: tensorpack.dataflow
:members:
:undoc-members:
...
...
docs/modules/tfutils.rst
View file @
a36ad180
tensorpack.tfutils package
==========================
.. container:: custom-index
.. raw:: html
<script type="text/javascript" src='../_static/build_toc_group.js'></script>
tensorpack.tfutils.collection module
------------------------------------
...
...
@@ -25,14 +31,6 @@ tensorpack.tfutils.gradproc module
:undoc-members:
:show-inheritance:
tensorpack.tfutils.model_utils module
--------------------------------------
.. automodule:: tensorpack.tfutils.model_utils
:members:
:undoc-members:
:show-inheritance:
tensorpack.tfutils.scope_utils module
--------------------------------------
...
...
docs/modules/utils.rst
View file @
a36ad180
...
...
@@ -82,12 +82,3 @@ tensorpack.utils.viz module
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: tensorpack.utils
:members:
:undoc-members:
:show-inheritance:
docs/requirements.txt
View file @
a36ad180
termcolor
numpy
tqdm
tensorflow
Sphinx>=1.6
recommonmark==0.4.0
sphinx_rtd_theme
mock
tensorflow
tensorpack/models/_test.py
View file @
a36ad180
...
...
@@ -3,6 +3,7 @@
# File: _test.py
# Author: Yuxin Wu <ppwwyyxx@gmail.com>
import
logging
import
tensorflow
as
tf
import
unittest
...
...
@@ -33,7 +34,7 @@ if __name__ == '__main__':
import
tensorpack
from
tensorpack.utils
import
logger
from
.
import
*
logger
.
disable_logger
(
)
logger
.
setLevel
(
logging
.
CRITICAL
)
subs
=
tensorpack
.
models
.
_test
.
TestModel
.
__subclasses__
()
for
cls
in
subs
:
run_test_case
(
cls
)
tensorpack/tfutils/distributions.py
View file @
a36ad180
...
...
@@ -83,8 +83,8 @@ class Distribution(object):
@
class_scope
def
entropy
(
self
,
x
,
theta
):
r"""
Entropy of this distribution parameterized by theta,
estimated from a batch of samples.
r"""
Entropy of this distribution parameterized by theta,
estimated from a batch of samples.
.. math::
...
...
tensorpack/utils/argtools.py
View file @
a36ad180
...
...
@@ -50,6 +50,7 @@ def graph_memoized(func):
kwargs
.
pop
(
GRAPH_ARG_NAME
)
return
func
(
*
args
,
**
kwargs
)
@
functools
.
wraps
(
func
)
def
wrapper
(
*
args
,
**
kwargs
):
assert
GRAPH_ARG_NAME
not
in
kwargs
,
"No Way!!"
graph
=
tf
.
get_default_graph
()
...
...
tensorpack/utils/logger.py
View file @
a36ad180
...
...
@@ -11,7 +11,7 @@ from datetime import datetime
from
six.moves
import
input
import
sys
__all__
=
[
'set_logger_dir'
,
'
disable_logger'
,
'
auto_set_dir'
]
__all__
=
[
'set_logger_dir'
,
'auto_set_dir'
]
class
_MyFormatter
(
logging
.
Formatter
):
...
...
@@ -46,9 +46,10 @@ _LOGGING_METHOD = ['info', 'warning', 'error', 'critical', 'warn', 'exception',
# export logger functions
for
func
in
_LOGGING_METHOD
:
locals
()[
func
]
=
getattr
(
_logger
,
func
)
__all__
.
append
(
func
)
def
get_time_str
():
def
_
get_time_str
():
return
datetime
.
now
()
.
strftime
(
'
%
m
%
d-
%
H
%
M
%
S'
)
...
...
@@ -61,7 +62,7 @@ _FILE_HANDLER = None
def
_set_file
(
path
):
global
_FILE_HANDLER
if
os
.
path
.
isfile
(
path
):
backup_name
=
path
+
'.'
+
get_time_str
()
backup_name
=
path
+
'.'
+
_
get_time_str
()
shutil
.
move
(
path
,
backup_name
)
info
(
"Log file '{}' backuped to '{}'"
.
format
(
path
,
backup_name
))
# noqa: F821
hdl
=
logging
.
FileHandler
(
...
...
@@ -97,13 +98,13 @@ If you're resuming from a previous run you can choose to keep it.""")
action
=
input
()
.
lower
()
.
strip
()
act
=
action
if
act
==
'b'
:
backup_name
=
dirname
+
get_time_str
()
backup_name
=
dirname
+
_
get_time_str
()
shutil
.
move
(
dirname
,
backup_name
)
info
(
"Directory '{}' backuped to '{}'"
.
format
(
dirname
,
backup_name
))
# noqa: F821
elif
act
==
'd'
:
shutil
.
rmtree
(
dirname
)
elif
act
==
'n'
:
dirname
=
dirname
+
get_time_str
()
dirname
=
dirname
+
_
get_time_str
()
info
(
"Use a new log directory {}"
.
format
(
dirname
))
# noqa: F821
elif
act
==
'k'
:
pass
...
...
@@ -117,12 +118,6 @@ If you're resuming from a previous run you can choose to keep it.""")
_set_file
(
os
.
path
.
join
(
dirname
,
'log.log'
))
def
disable_logger
():
""" Disable all logging ability from this moment"""
for
func
in
_LOGGING_METHOD
:
globals
()[
func
]
=
lambda
x
:
None
def
auto_set_dir
(
action
=
None
,
name
=
None
):
"""
Use :func:`logger.set_logger_dir` to set log directory to
...
...
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