<jupyter_start><jupyter_text>Data Augmentation---- Form a group $\Bigg \{ A_{ug}, U_{ga}, G_{au} ...... \Bigg \}$, sometimes not commutative/Abelian- $\subset \text{unary operator}: Signal \Longrightarrow Signal $ (making it a group action)    - $\subset \text{**higher-order function**}$  Data Augmentation<jupyter_code>g = nx.DiGraph(directed=True)

n = 'numbers'
n2 = ' numbers'
f = 'function'
f2 = ' function'
o = '**operator**'
c = '**currying**'
fl = '**functional**'

g.add_nodes_from([n])
g.add_nodes_from([f, fl, o, c])
g.add_nodes_from([n2, f2])

g.add_edge(n, f, wedge=True)
g.add_edge(f, n2)
g.add_edge(f, o, wedge=True)
g.add_edge(o, f2)
g.add_edge(f, fl, wedge=True)
g.add_edge(fl, n2)
g.add_edge(n, c, wedge=True)
g.add_edge(c, f2)

drawGraph(g, font_family='humor sans',  arrow='-|>')

plt.show()<jupyter_output><empty_output><jupyter_text>Data Augmentation $\Longrightarrow$ G-ConvNet**Lemma**: If the augmentation group $\{ A_{ug} \}$ satisifes:- **Transitivity**: for any pair of points $x, y$ and any function $f$, we can always find an augmentation that can transform value $f(x)$ to point $y$- **Group Equivariance**: applying an augmentation $A_{ug}$ on the input has the same effect as applying an augmentation $U_{ga}$ from the same group on the outputThen a fully connected layer:$$f_+(y) =  _x$$collapses to a group convolution (**G-conv**) layer:$$f_+(y) =  _x$$---Looks familiar?$$conv(f(- \Delta), w_0(\Delta)) = corr(f(\Delta), w_0(\Delta)) =  _x$$  Data Augmentation $\Longrightarrow$ G-ConvNet$$f_+(y) =  _x$$---In short: A ConvNet layer is just an augmented Linear/Fully-Connected layer!  Data Augmentation - Transitivity**Transitivity**: for any pair of points $x, y$ and any function $f$, we can always find an augmentation that can transform value $f(x)$ to point $y$$$\forall x : f(x) = \Big( A_{ug} \circ f \Big) (x_0)$$  Data Augmentation - Transitivity- Effectively means the augmentation group is the 'carriage' to move reference frame around the observer--- [*] Image courtesy: udacity.com  Data Augmentation - EquivariancePlain old **Equivariance**: applying an augmentation $A_{ug}$ on the input has the same effect as applying $A_{ug}$ on the output$$A_{ug} \circ f_+(y) =  _x$$  Data Augmentation - Equivariance- example: SQL prediate pushdown- example: first input & final output of Masked-CNN & Autoencoder (& maybe Style Transfer)          Data Augmentation - Group Equivariance**Group Equivariance**: applying an augmentation $A_{ug}$ on the input has the same effect as applying an augmentation **$U_{ga}$ from the same group** on the output$$U_{ga} \circ f_+(y) =  _x$$---- Relaxed a bit comparing to Plain old equivariance- Effectively means that the architecture of the first layer can be carried over to the subsequent layers with little changes, applied on high-level features  Data Augmentation - Group Equivariance<jupyter_code>g = nx.DiGraph(directed=True)

fs = [
    "$f(.)$",
    "$f_+(.)$",
    "$f_{++}(.)$",
    "$f_{+++}(.)$",
    "..."
]

afs = [
    "$A_{ug} \circ f(.)$",
    "$U_{ga} \circ f_+(.)$",
    "$G_{au} \circ f_{++}(.)$",
    "$A_{gu} \circ f_{++}(.)$",
    " ... "
]

for i in range(0, 4):
    g.add_edge(fs[i], fs[i + 1], text='||')
    g.add_edge(afs[i], afs[i + 1], text='||')
#     g.add_edge(fs[i], afs[i])

g2 = g.copy()

for i in range(0, 4):
    g2.add_edge(fs[i], afs[i], text='Augment')

g2.add_edge(afs[0], fs[1], text='Bag-of-Words (DON\'T DO THIS)')

drawGraph(g2, layoutG=g)

plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.17938496583143507, 'fraction_numerical': 0.006548974943052392, 'mean_word_length': 4.412942989214176, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 10, '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': '115030', 'license': 'Apache-2.0', 'n_tokens_mistral': 1304, 'n_tokens_neox': 1239, 'n_words': 389, 'path': 'slide/C-aug.ipynb', 'repo_name': 'tribbloid/convnet-abstraction', 'size': '3512'}