<commit_before>#!/usr/bin/env python3

import DeepFried2 as df

import unittest
import numpy as np

class TestStoreOut(unittest.TestCase):

    def test(self):
        net = df.StoreOut(df.Linear(2,3))

        net.training()
        X = np.array([[1,2],[3,4]], dtype=df.floatX)
        Y = net.forward(X)
        np.testing.assert_array_equal(net.out, Y)

        net.evaluate()
        X = np.array([[10,20],[30,40]], dtype=df.floatX)
        Y = net.forward(X)
        np.testing.assert_array_equal(net.out, Y)

    def testMulti(self):
        net = df.StoreOut(df.Identity())

        net.training()<commit_msg>Add another StoreOut test.<commit_after>#!/usr/bin/env python3

import DeepFried2 as df

import unittest
import numpy as np

class TestStoreOut(unittest.TestCase):

    def test(self):
        net = df.StoreOut(df.Linear(2,3))

        net.training()
        X = np.array([[1,2],[3,4]], dtype=df.floatX)
        Y = net.forward(X)
        np.testing.assert_array_equal(net.out, Y)

        Y = net.forward(X*2)
        np.testing.assert_array_equal(net.out, Y)

        net.evaluate()
        X = np.array([[10,20],[30,40]], dtype=df.floatX)
        Y = net.forward(X)
        np.testing.assert_array_equal(net.out, Y)

    def testMulti(self):
        net = df.StoreOut(df.Identity())

        net.training()
{'fraction_non_alphanumeric': 0.1509433962264151, 'fraction_numerical': 0.02490566037735849, 'mean_word_length': 2.5549597855227884, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3096499', 'n_tokens_mistral': 492, 'n_tokens_neox': 462, 'n_words': 84}