コード例 #1
0
    def test_hinton_only_negative(self):
        original_image_name = format_image_name("hinton_only_negative.png")
        original_image = os.path.join(IMGDIR, original_image_name)

        with image_comparison(original_image, figsize=(10, 6)) as fig:
            weight = -np.random.random((20, 20))
            ax = fig.add_subplot(1, 1, 1)
            plots.hinton(weight, ax=ax)
コード例 #2
0
    def test_hinton_1darray(self):
        original_image_name = format_image_name("hinton_1darray.png")
        original_image = os.path.join(IMGDIR, original_image_name)

        with image_comparison(original_image, figsize=(10, 4)) as fig:
            weight = -np.random.randn(20)
            ax = fig.add_subplot(1, 1, 1)
            plots.hinton(weight, ax=ax)
コード例 #3
0
    def test_max_weight(self):
        original_image_name = format_image_name("max_weight_hinton.png")
        original_image = os.path.join(IMGDIR, original_image_name)

        with image_comparison(original_image, figsize=(10, 6)) as fig:
            weight = 100 * np.random.randn(20, 20)
            ax = fig.add_subplot(1, 1, 1)
            plots.hinton(weight, ax=ax, max_weight=10, add_legend=True)
コード例 #4
0
    def test_hinton_without_legend(self):
        original_image_name = format_image_name("hinton_without_legend.png")
        original_image = os.path.join(IMGDIR, original_image_name)

        with image_comparison(original_image, figsize=(10, 6)) as fig:
            weight = np.random.randn(20, 20)
            ax = fig.add_subplot(1, 1, 1)
            plots.hinton(weight, ax=ax, add_legend=False)
コード例 #5
0
    def test_hinton_1darray(self):
        fig = plt.figure()
        ax = fig.add_subplot(1, 1, 1)

        weight = -np.random.randn(20)
        plots.hinton(weight, ax=ax)

        return fig
コード例 #6
0
    def test_hinton_without_legend(self):
        fig = plt.figure()
        ax = fig.add_subplot(1, 1, 1)

        weight = np.random.randn(20, 20)
        plots.hinton(weight, ax=ax, add_legend=False)

        return fig
コード例 #7
0
    def test_hinton_only_negative(self):
        fig = plt.figure()
        ax = fig.add_subplot(1, 1, 1)

        weight = -np.random.random((20, 20))
        plots.hinton(weight, ax=ax)

        return fig
コード例 #8
0
ファイル: test_hinton.py プロジェクト: EdwardBetts/neupy
    def test_hinton_1darray(self):
        original_image_name = format_image_name("hinton_1darray.png")
        original_image = os.path.join(IMGDIR, original_image_name)

        with image_comparison(original_image, figsize=(10, 4)) as fig:
            weight = -np.random.randn(20)
            ax = fig.add_subplot(1, 1, 1)
            plots.hinton(weight, ax=ax)
コード例 #9
0
    def test_max_weight(self):
        fig = plt.figure()
        ax = fig.add_subplot(1, 1, 1)

        weight = 100 * np.random.randn(20, 20)
        plots.hinton(weight, ax=ax, max_weight=10, add_legend=True)

        return fig
コード例 #10
0
ファイル: test_hinton.py プロジェクト: EdwardBetts/neupy
    def test_hinton_only_negative(self):
        original_image_name = format_image_name("hinton_only_negative.png")
        original_image = os.path.join(IMGDIR, original_image_name)

        with image_comparison(original_image, figsize=(10, 6)) as fig:
            weight = -np.random.random((20, 20))
            ax = fig.add_subplot(1, 1, 1)
            plots.hinton(weight, ax=ax)
コード例 #11
0
ファイル: test_hinton.py プロジェクト: EdwardBetts/neupy
    def test_hinton_without_legend(self):
        original_image_name = format_image_name("hinton_without_legend.png")
        original_image = os.path.join(IMGDIR, original_image_name)

        with image_comparison(original_image, figsize=(10, 6)) as fig:
            weight = np.random.randn(20, 20)
            ax = fig.add_subplot(1, 1, 1)
            plots.hinton(weight, ax=ax, add_legend=False)
コード例 #12
0
ファイル: test_hinton.py プロジェクト: EdwardBetts/neupy
    def test_max_weight(self):
        original_image_name = format_image_name("max_weight_hinton.png")
        original_image = os.path.join(IMGDIR, original_image_name)

        with image_comparison(original_image, figsize=(10, 6)) as fig:
            weight = 100 * np.random.randn(20, 20)
            ax = fig.add_subplot(1, 1, 1)
            plots.hinton(weight, ax=ax, max_weight=10, add_legend=True)
コード例 #13
0
    def test_simple_hinton(self):
        original_image_name = format_image_name("simple_hinton.png")
        original_image = os.path.join(IMGDIR, original_image_name)

        with image_comparison(original_image, figsize=(10, 6)) as fig:
            weight = np.random.randn(20, 20)
            ax = fig.add_subplot(1, 1, 1)
            plt.sca(ax)  # To test the case when ax=None
            plots.hinton(weight, add_legend=True)
コード例 #14
0
    def test_simple_hinton(self):
        fig = plt.figure()
        ax = fig.add_subplot(1, 1, 1)
        plt.sca(ax)  # To test the case when ax=None

        weight = np.random.randn(20, 20)
        plots.hinton(weight, add_legend=True)

        return fig
コード例 #15
0
ファイル: test_hinton.py プロジェクト: EdwardBetts/neupy
    def test_simple_hinton(self):
        original_image_name = format_image_name("simple_hinton.png")
        original_image = os.path.join(IMGDIR, original_image_name)

        with image_comparison(original_image, figsize=(10, 6)) as fig:
            weight = np.random.randn(20, 20)
            ax = fig.add_subplot(1, 1, 1)
            plt.sca(ax)  # To test the case when ax=None
            plots.hinton(weight, add_legend=True)