本文整理汇总了Python中Debug.debug_shell方法的典型用法代码示例。如果您正苦于以下问题:Python Debug.debug_shell方法的具体用法?Python Debug.debug_shell怎么用?Python Debug.debug_shell使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Debug
的用法示例。
在下文中一共展示了Debug.debug_shell方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: demo
# 需要导入模块: import Debug [as 别名]
# 或者: from Debug import debug_shell [as 别名]
outputs[0][0] = loss
outputs[1][0] = errsig
print >> log.v5, 'avg frame loss for segments:', loss.sum() / seq_lengths.sum(),
print >> log.v5, 'time-frames:', seq_lengths.sum()
def demo():
print "Note: Load this module via Sprint python-trainer to really use it."
print "We are running a demo now."
init(inputDim=493, outputDim=4501, config="", # hardcoded, just a demo...
targetMode="criterion-by-sprint", cudaEnabled=False, cudaActiveGpu=-1)
assert os.path.exists("input-features.npy"), "run Sprint with python-trainer=dump first"
features = numpy.load("input-features.npy") # dumped via dump.py
posteriors = feedInput(features)
if not os.path.exists("posteriors.npy"):
numpy.save("posteriors.npy", posteriors)
print "Saved posteriors.npy. Now run Sprint with python-trainer=dump again."
sys.exit()
old_posteriors = numpy.load("posteriors.npy")
assert numpy.array_equal(posteriors, old_posteriors)
error = numpy.load("output-error.npy") # dumped via dump.py
error = float(error)
errorSignal = numpy.load("output-error-signal.npy") # dumped via dump.py
finishError(error=error, errorSignal=errorSignal, naturalPairingType="softmax")
exit()
if __name__ == "__main__":
Debug.debug_shell(user_ns=locals(), user_global_ns=globals())