<jupyter_start><jupyter_text>Let's try a simple definition-based convolution hereWe have a (4, ) input and a (3, ) filter: the output has a dimension of (2, )<jupyter_code>in_FM = np.array([1,2,3,4]).reshape((4,1))
filt = np.array([5,6,7]).reshape((3,1))

output = np.zeros(2)
for i in range(2):
    output[i] = np.sum([filt[f_index] * in_FM[i + f_index] for f_index in range(len(filt))])
    
print output<jupyter_output>[ 38.  56.]<jupyter_text>A simple example for 1D WinogradWe have a (4, ) input and a (3, ) filter: the output has a dimension of (2, )<jupyter_code>A = np.array([[1,1,1,0],[0,1,-1,-1]]).T
B = np.array([[1,0,-1,0],[0,1,1,0],[0,-1,1,0],[0,1,0,-1]]).T
G = np.array([[1,0,0],[0.5,0.5,0.5],[0.5,-0.5,0.5],[0,0,1]])

in_FM = np.array([1,2,3,4]).reshape((4,1))
filt = np.array([5,6,7]).reshape((3,1))

output = A.T.dot((G.dot(filt)) * (B.T.dot(in_FM)))
print output
A = np.array([[1,1,1,0],[0,1,-1,-1]]).T
B = np.array([[1,0,-1,0],[0,1,1,0],[0,-1,1,0],[0,1,0,-1]]).T
G = np.array([[1,0,0],[0.5,0.5,0.5],[0.5,-0.5,0.5],[0,0,1]])

# in_FM = np.array([1,2,3,4]).reshape((4,1))
# filt = np.array([5,6,7]).reshape((3,1))

in_FM = np.array([[1],[2],[3],[4]])
filt = np.array([[5],[6],[7]])

output = A.T.dot((G.dot(filt)) * (B.T.dot(in_FM)))
print output<jupyter_output>[[ 38.]
 [ 56.]]
{'fraction_non_alphanumeric': 0.3065637065637066, 'fraction_numerical': 0.10888030888030888, 'mean_word_length': 5.14218009478673, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '15662', 'license': 'MIT', 'n_tokens_mistral': 695, 'n_tokens_neox': 668, 'n_words': 100, 'path': 'winograd_python/Winograd-based vgg.ipynb', 'repo_name': 'honorpeter/VGG16_FPGA_Accelerator', 'size': '1295'}