This commit is contained in:
Willi Richert 2016-03-29 18:20:43 +02:00
Родитель 2d5423fcf8
Коммит ef57a742aa
4 изменённых файлов: 10 добавлений и 11 удалений

Просмотреть файл

@ -8,10 +8,7 @@ import shutil as sh
from cntk.graph import ComputationNode
from cntk.ops.cntk1 import NewReshape
from cntk.utils import CNTK_EXECUTABLE_PATH
_FLOATX = 'float32'
from cntk.utils import CNTK_EXECUTABLE_PATH, MODEL_INDENTATION
CNTK_TEMPLATE_DIR = os.path.join(os.path.dirname(__file__), "templates")
CNTK_TRAIN_TEMPLATE_PATH = os.path.join(
@ -202,7 +199,7 @@ class AbstractContext(object, metaclass=ABCMeta):
from .ops.cntk1 import Input
dummy_input_node = Input(2, var_name='dummy_node')
reader.add_input(dummy_input_node, 0, 2)
model_description += "dummy_node = Input(2, tag='output')"
model_description += "\n" + " "*MODEL_INDENTATION + "dummy_node = Input(2, tag='output')"
readers.append(reader)
tmpl = open(CNTK_EVAL_TEMPLATE_PATH, "r").read()

Просмотреть файл

@ -2,13 +2,11 @@ from abc import ABCMeta, abstractmethod
import numpy as np
import scipy.sparse as sparse
from .utils import MODEL_INDENTATION
def _tuple_to_cntk_shape(shape):
return ':'.join(str(v) for v in shape)
# Indent model description by how many spaces
MODEL_INDENTATION = 8
class ComputationNode(object):

Просмотреть файл

@ -76,10 +76,10 @@ class UCIFastReader(AbstractReader):
else:
name = name_or_node
template += '''\
template += '''
{0} = [
start = {1}
dim = {2}
dim = {2}
'''.format(name, start, dim)
if num_of_classes:
@ -91,7 +91,7 @@ class UCIFastReader(AbstractReader):
labelMappingFile= "{0}"
'''.format(map_file)
template += '''\
template += '''
]
'''

Просмотреть файл

@ -5,3 +5,7 @@ if "CNTK_EXECUTABLE_PATH" not in os.environ:
"you need to point environmental variable 'CNTK_EXECUTABLE_PATH' to the CNTK binary")
CNTK_EXECUTABLE_PATH = os.environ['CNTK_EXECUTABLE_PATH']
# Indent model description by how many spaces
MODEL_INDENTATION = 8