提交 fa6bd29f authored 作者: Frederic Bastien's avatar Frederic Bastien

added test for the example logistic_regression

上级 2af541a0
...@@ -85,7 +85,7 @@ class LogisticRegression2(module.FancyModule): ...@@ -85,7 +85,7 @@ class LogisticRegression2(module.FancyModule):
if __name__ == '__main__': def main():
pprint.assign(nnet.crossentropy_softmax_1hot_with_bias_dx, printing.FunctionPrinter('xsoftmaxdx')) pprint.assign(nnet.crossentropy_softmax_1hot_with_bias_dx, printing.FunctionPrinter('xsoftmaxdx'))
pprint.assign(nnet.crossentropy_softmax_argmax_1hot_with_bias, printing.FunctionPrinter('nll', 'softmax', 'argmax')) pprint.assign(nnet.crossentropy_softmax_argmax_1hot_with_bias, printing.FunctionPrinter('nll', 'softmax', 'argmax'))
if 1: if 1:
...@@ -135,6 +135,8 @@ if __name__ == '__main__': ...@@ -135,6 +135,8 @@ if __name__ == '__main__':
print 'TRAINED MODEL:' print 'TRAINED MODEL:'
print lr print lr
if __name__ == '__main__':
main()
#
# UNIT TEST
#
import unittest
import numpy
from theano import gof
from theano.gradient import *
from theano import gradient
import sys
from theano import tensor as T
from theano.tensor import nnet
from theano.compile import module
from theano import printing, pprint
from theano import compile
import numpy as N
class test_logistic_regression_example(unittest.TestCase):
def test_example(self):
"""Test that the file execute without trouble"""
from ..examples import logistic_regression
logistic_regression.main()
if __name__ == '__main__':
unittest.main()
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论