Repository: baler-collaboration/baler (language: python)

Issue:
Minor changes



Discussion / hints:

Fix patch:
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 00000000..d6456956
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,202 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
diff --git a/NOTICE b/NOTICE
new file mode 100644
index 00000000..91a70291
--- /dev/null
+++ b/NOTICE
@@ -0,0 +1,61 @@
+Baler
+Copyright 2022, Alexander Ekman
+Copyright 2022, Axel Gallén
+Copyright 2022, Oliver Woolland
+Copyright 2023, Fritjof Bengtsson
+Copyright 2023, Caterina Doglioni
+Copyright 2023, Pratik Jawahar
+Copyright 2023, Marta Camps Santasmasas
+Copyright 2023, Nicole Skidmore
+Copyright 2023, Alma Orucevic-Alagic
+Copyright 2023, Radek Skaroupka
+Copyright 2023, Shaoxuan Xu
+
+This work includes functions based on previous work by George Dialektakis (https://github.com/Autoencoders-compression-anomaly/Deep-Autoencoders-Data-Compression-GSoC-2021). Specifically the functions marked as with their copyright notice in baler/modules/models.py and baler/modules/utils.py.
+Their work is released under the Apache License 2.0 found at https://www.apache.org/licenses/LICENSE-2.0.txt
+Copyright 2021 George Dialektakis
+
+This work includes software developed by Michael Oliver (https://github.com/michaeloliverx/python-poetry-docker-example). Specifically baler/Dockerfile and baler/Dockerfile.arm64. Their work is released under the MIT license.
+Copyright 2020 Michael Oliver
+
+This work includes software developed by python-poetry and Sébastien Eustace (https://github.com/python-poetry/poetry). Specifically baler/poetry.lock is generated by their software. Their work is released under the MIT license.
+Copyright 2018-present Sébastien Eustace
+
+===================================================================================
+
+Baler has received funding from the Alan Turing Institute through
+a Turing-Manchester Feasibility Project grant
+
+===================================================================================
+
+Baler was inspired by previous work from:
+
+"Deep Autoencoders for Compression in High Energy Physics" (http://lup.lub.lu.se/student-papers/record/9004751)
+Copyright 2020 Eric Wulff, supervised by Caterina Doglioni, Lukas Heinrich and Antonio Boveia
+
+"Tests of Autoencoder Compression of Trigger Jets in the ATLAS Experiment" (http://lup.lub.lu.se/student-papers/record/9012882)
+Copyright 2020 Erik Wallin, supervised by Caterina Doglioni
+
+"Deep-compression for High Energy Physics data - Google Summer of Code 2020 Project" (https://medium.com/@hn.gpt1/deep-compression-for-high-energy-physics-data-google-summer-of-code20-3dea5acc7bcf and https://zenodo.org/record/4012511#.ZBxqsi-l3fb)
+Copyright 2020 Honey Gupta, supervised by Caterina Doglioni, Lukas Heinrich, Antonio Boveia and Baptiste Ravina
+
+“Autoencoders for Trigger-Level Analysis - 2020 Ohio State Department of Physics Summer Research Program” (https://zenodo.org/record/4323594#.ZBxq2y-l3fY)
+Copyright 2020 Sam Roberts, supervised by Antonio Boveia, Caterina Doglioni 
+
+"Deep Autoencoders for ATLAS Data Compression - Google Summer of Code 2021 Project" (https://doi.org/10.5281/zenodo.5482611)
+Copyright 2021 George Dialektakis, supervised by Caterina Doglioni, Lukas Heinrich and Antonio Boveia (with help by Alex Gekow)
+
+"Evaluation of float-truncation based compression techniques for the ATLAS jet trigger" (http://lup.lub.lu.se/student-papers/record/9049610)
+Copyright 2021 Love Kildetoft, supervised by Caterina Doglioni and Antonio Boveia
+
+“Investigation of Autoencoders for Jet Images in Particle Physics” (https://lup.lub.lu.se/student-papers/record/9041079 )
+Copyright 2021 Jessica Lastow, supervised by Caterina Doglioni and Antonio Boveia
+
+"Autoencoder Compression in High Energy Physics" (http://lup.lub.lu.se/student-papers/record/9075881)
+Copyright 2022 Sten Åstrand, supervised by Caterina Doglioni and Lukas Heinrich
+
+“Autoencoder compression and comparison to PCA - IRIS-HEP fellow (https://iris-hep.org/fellows/70752300.html)
+Copyright 2022 Maxym Nauchyk, supervised by Caterina Doglioni and Alexander Ekman
+
+“The Dark Machines Anomaly Score Challenge: Benchmark Data and Model Independent Event Classification for the Large Hadron Collider”, doi: 10.21468/SciPostPhys.12.1.043
+
diff --git a/README.md b/README.md
index 397b4f5c..6befb485 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,4 @@
+[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
 ![example workflow](https://github.com/baler-compressor/baler/actions/workflows/test_and_lint.yaml/badge.svg)
 ![example workflow](https://github.com/baler-compressor/baler/actions/workflows/docker.yaml/badge.svg)
 
diff --git a/baler/baler.py b/baler/baler.py
index d2a04faf..6a049b44 100644
--- a/baler/baler.py
+++ b/baler/baler.py
@@ -1,3 +1,17 @@
+# Copyright 2022 Baler Contributors
+
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+
+#     http://www.apache.org/licenses/LICENSE-2.0
+
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
 import os
 import time
 
diff --git a/baler/modules/data_processing.py b/baler/modules/data_processing.py
index 2123235f..b80478ba 100644
--- a/baler/modules/data_processing.py
+++ b/baler/modules/data_processing.py
@@ -1,3 +1,17 @@
+# Copyright 2022 Baler Contributors
+
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+
+#     http://www.apache.org/licenses/LICENSE-2.0
+
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
 import numpy as np
 import torch
 from sklearn.model_selection import train_test_split
diff --git a/baler/modules/helper.py b/baler/modules/helper.py
index 43344a0b..cbb63c1e 100644
--- a/baler/modules/helper.py
+++ b/baler/modules/helper.py
@@ -1,3 +1,17 @@
+# Copyright 2022 Baler Contributors
+
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+
+#     http://www.apache.org/licenses/LICENSE-2.0
+
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
 import argparse
 import importlib
 import os
diff --git a/baler/modules/models.py b/baler/modules/models.py
index 7bf5c42d..e648b097 100644
--- a/baler/modules/models.py
+++ b/baler/modules/models.py
@@ -1,10 +1,23 @@
+# Copyright 2022 Baler Contributors
+
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+
+#     http://www.apache.org/licenses/LICENSE-2.0
+
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
 import torch
 from torch import nn
 from torch.nn import functional as F
 
 
 class AE(nn.Module):
-
     # This class is a modified version of the original class by George Dialektakis found at
     # https://github.com/Autoencoders-compression-anomaly/Deep-Autoencoders-Data-Compression-GSoC-2021
     # Released under the Apache License 2.0 found at https://www.apache.org/licenses/LICENSE-2.0.txt
diff --git a/baler/modules/plotting.py b/baler/modules/plotting.py
index 41348b5c..8570ee67 100644
--- a/baler/modules/plotting.py
+++ b/baler/modules/plotting.py
@@ -1,3 +1,17 @@
+# Copyright 2022 Baler Contributors
+
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+
+#     http://www.apache.org/licenses/LICENSE-2.0
+
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
 import matplotlib.pyplot as plt
 import numpy as np
 from tqdm import tqdm
@@ -30,7 +44,7 @@ def loss_plot(path_to_loss_data, output_path, config):
     plt.title("Loss plot")
     plt.plot(train_loss, color="orange", label="Train Loss")
     if config.test_size:
-        plt.plot(val_loss, color="red", label="Validation Loss")    
+        plt.plot(val_loss, color="red", label="Validation Loss")
     for i in range(len(conf_list)):
         plt.plot([], [], " ", label=str_list[i] + " " + str(conf_list[i]))
     plt.xlabel("Epochs")
diff --git a/baler/modules/training.py b/baler/modules/training.py
index 19689082..13a9e0ed 100644
--- a/baler/modules/training.py
+++ b/baler/modules/training.py
@@ -1,3 +1,17 @@
+# Copyright 2022 Baler Contributors
+
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+
+#     http://www.apache.org/licenses/LICENSE-2.0
+
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
 import os
 import random
 import time
@@ -14,7 +28,6 @@
 def fit(
     model, train_dl, model_children, regular_param, optimizer, RHO, l1, n_dimensions
 ):
-
     """This function trains the model on the train set. It computes the losses and does the backwards propagation, and updates the optimizer as well.
 
     Args:
@@ -105,7 +118,6 @@ def seed_worker(worker_id):
 
 
 def train(model, variables, train_data, test_data, project_path, config):
-
     """Calls the `fit()` and `validate()` functions in a loop, which defines how many "times" the network should be trained.
 
     Args:
diff --git a/baler/modules/utils.py b/baler/modules/utils.py
index f7efd0e5..371abc30 100644
--- a/baler/modules/utils.py
+++ b/baler/modules/utils.py
@@ -1,3 +1,17 @@
+# Copyright 2022 Baler Contributors
+
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+
+#     http://www.apache.org/licenses/LICENSE-2.0
+
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
 import torch
 import torch.nn as nn
 from scipy.stats import wasserstein_distance
@@ -52,7 +66,6 @@ def mse_loss_emd_l1(model_children, true_data, reconstructed_data, reg_param, va
 
 
 def mse_loss_l1(model_children, true_data, reconstructed_data, reg_param, validate):
-
     # This function is a modified version of the original function by George Dialektakis found at
     # https://github.com/Autoencoders-compression-anomaly/Deep-Autoencoders-Data-Compression-GSoC-2021
     # Released under the Apache License 2.0 found at https://www.apache.org/licenses/LICENSE-2.0.txt
diff --git a/models_CFD.py b/models_CFD.py
deleted file mode 100644
index 15ed0be4..00000000
--- a/models_CFD.py
+++ /dev/null
@@ -1,296 +0,0 @@
-import torch
-from torch import nn
-from torch.nn import functional as F
-
-
-class george_SAE(nn.Module):
-    def __init__(self, n_features, z_dim, *args, **kwargs):
-        super().__init__(*args, **kwargs)
-
-        # encoder
-        self.en1 = nn.Linear(n_features, 200, dtype=torch.float64)
-        self.en2 = nn.Linear(200, 100, dtype=torch.float64)
-        self.en3 = nn.Linear(100, 50, dtype=torch.float64)
-        self.en4 = nn.Linear(50, z_dim, dtype=torch.float64)
-        # decoder
-        self.de1 = nn.Linear(z_dim, 50, dtype=torch.float64)
-        self.de2 = nn.Linear(50, 100, dtype=torch.float64)
-        self.de3 = nn.Linear(100, 200, dtype=torch.float64)
-        self.de4 = nn.Linear(200, n_features, dtype=torch.float64)
-
-        self.n_features = n_features
-        self.z_dim = z_dim
-
-    def encode(self, x):
-        h1 = F.leaky_relu(self.en1(x))
-        h2 = F.leaky_relu(self.en2(h1))
-        h3 = F.leaky_relu(self.en3(h2))
-        return self.en4(h3)
-
-    def decode(self, z):
-        h4 = F.leaky_relu(self.de1(z))
-        h5 = F.leaky_relu(self.de2(h4))
-        h6 = F.leaky_relu(self.de3(h5))
-        out = self.de4(h6)
-        return out
-
-    def forward(self, x):
-        z = self.encode(x)
-        return self.decode(z)
-
-
-class george_SAE_BN(nn.Module):
-    def __init__(self, n_features, z_dim):
-        super(george_SAE_BN, self).__init__()
-
-        # encoder
-        self.enc_nn = nn.Sequential(
-            nn.Linear(n_features, 200, dtype=torch.float64),
-            # nn.Dropout(p=0.5),
-            nn.LeakyReLU(),
-            nn.BatchNorm1d(200, dtype=torch.float64),
-            nn.Linear(200, 100, dtype=torch.float64),
-            # nn.Dropout(p=0.4),
-            nn.LeakyReLU(),
-            nn.BatchNorm1d(100, dtype=torch.float64),
-            nn.Linear(100, 50, dtype=torch.float64),
-            # nn.Dropout(p=0.3),
-            nn.LeakyReLU(),
-            nn.BatchNorm1d(50, dtype=torch.float64),
-            nn.Linear(50, z_dim, dtype=torch.float64),
-            # nn.Dropout(p=0.2),
-            nn.LeakyReLU(),
-            nn.BatchNorm1d(z_dim, dtype=torch.float64),
-        )
-
-        # decoder
-        self.dec_nn = nn.Sequential(
-            nn.Linear(z_dim, 50, dtype=torch.float64),
-            # nn.Dropout(p=0.2),
-            nn.LeakyReLU(),
-            # nn.BatchNorm1d(50,dtype=torch.float64),
-            nn.Linear(50, 100, dtype=torch.float64),
-            # nn.Dropout(p=0.3),
-            nn.LeakyReLU(),
-            # nn.BatchNorm1d(100,dtype=torch.float64),
-            nn.Linear(100, 200, dtype=torch.float64),
-            # nn.Dropout(p=0.4),
-            nn.LeakyReLU(),
-            # nn.BatchNorm1d(200,dtype=torch.float64),
-            nn.Linear(200, n_features, dtype=torch.float64),
-            # nn.Dropout(p=0.5),
-            # nn.BatchNorm1d(n_features,dtype=torch.float64),
-            nn.ReLU(),
-        )
-
-        self.n_features = n_features
-        self.z_dim = z_dim
-
-    def encode(self, x):
-        out = self.enc_nn(x)
-        return out
-
-    def decode(self, z):
-        out = self.dec_nn(z)
-        return out
-
-    def forward(self, x):
-        z = self.encode(x)
-        return self.decode(z)
-
-
-class george_SAE_Dropout_BN(nn.Module):
-    def __init__(self, n_features, z_dim):
-        super(george_SAE_Dropout_BN, self).__init__()
-
-        # encoder
-        self.enc_nn = nn.Sequential(
-            nn.Linear(n_features, 200, dtype=torch.float64),
-            nn.Dropout(p=0.5),
-            nn.LeakyReLU(),
-            # nn.BatchNorm1d(200,dtype=torch.float64),
-            nn.Linear(200, 100, dtype=torch.float64),
-            nn.Dropout(p=0.4),
-            nn.LeakyReLU(),
-            # nn.BatchNorm1d(100,dtype=torch.float64),
-            nn.Linear(100, 50, dtype=torch.float64),
-            nn.Dropout(p=0.3),
-            nn.LeakyReLU(),
-            # nn.BatchNorm1d(50,dtype=torch.float64),
-            nn.Linear(50, z_dim, dtype=torch.float64),
-            nn.Dropout(p=0.2),
-            nn.LeakyReLU(),
-            # nn.BatchNorm1d(z_dim,dtype=torch.float64)
-        )
-
-        # decoder
-        self.dec_nn = nn.Sequential(
-            nn.Linear(z_dim, 50, dtype=torch.float64),
-            # nn.Dropout(p=0.2),
-            nn.LeakyReLU(),
-            nn.BatchNorm1d(50, dtype=torch.float64),
-            nn.Linear(50, 100, dtype=torch.float64),
-            # nn.Dropout(p=0.3),
-            nn.LeakyReLU(),
-            nn.BatchNorm1d(100, dtype=torch.float64),
-            nn.Linear(100, 200, dtype=torch.float64),
-            # nn.Dropout(p=0.4),
-            nn.LeakyReLU(),
-            nn.BatchNorm1d(200, dtype=torch.float64),
-            nn.Linear(200, n_features, dtype=torch.float64),
-            # nn.Dropout(p=0.5),
-            nn.BatchNorm1d(n_features, dtype=torch.float64),
-            nn.ReLU(),
-        )
-
-        self.n_features = n_features
-        self.z_dim = z_dim
-
-    def encode(self, x):
-        out = self.enc_nn(x)
-        return out
-
-    def decode(self, z):
-        out = self.dec_nn(z)
-        return out
-
-    def forward(self, x):
-        z = self.encode(x)
-        return self.decode(z)
-
-
-class george_SAE_Dropout(nn.Module):
-    def __init__(self, n_features, z_dim):
-        super(george_SAE_Dropout, self).__init__()
-
-        # encoder
-        self.enc_nn = nn.Sequential(
-            nn.Linear(n_features, 200, dtype=torch.float64),
-            nn.Dropout(p=0.5),
-            nn.LeakyReLU(),
-            nn.Linear(200, 100, dtype=torch.float64),
-            nn.Dropout(p=0.4),
-            nn.LeakyReLU(),
-            nn.Linear(100, 50, dtype=torch.float64),
-            nn.Dropout(p=0.3),
-            nn.LeakyReLU(),
-            nn.Linear(50, z_dim, dtype=torch.float64),
-            nn.Dropout(p=0.2),
-            nn.LeakyReLU(),
-        )
-
-        # decoder
-        self.dec_nn = nn.Sequential(
-            nn.Linear(z_dim, 50, dtype=torch.float64),
-            nn.Dropout(p=0.2),
-            nn.LeakyReLU(),
-            nn.Linear(50, 100, dtype=torch.float64),
-            nn.Dropout(p=0.3),
-            nn.LeakyReLU(),
-            nn.Linear(100, 200, dtype=torch.float64),
-            nn.Dropout(p=0.4),
-            nn.LeakyReLU(),
-            nn.Linear(200, n_features, dtype=torch.float64),
-            nn.Dropout(p=0.5),
-            nn.ReLU(),
-        )
-
-        self.n_features = n_features
-        self.z_dim = z_dim
-
-    def encode(self, x):
-        out = self.enc_nn(x)
-        return out
-
-    def decode(self, z):
-        out = self.dec_nn(z)
-        return out
-
-    def forward(self, x):
-        # z = x.view(batch_size,a,b,c) ? What is this
-        return self.decode(x)
-
-    def loss(self, model_children, true_data, reconstructed_data, reg_param):
-        mse = nn.MSELoss()
-        mse_loss = mse(reconstructed_data, true_data)
-        l1_loss = 0
-        values = true_data
-        for i in range(len(model_children)):
-            values = F.relu((model_children[i](values)))
-            l1_loss += torch.mean(torch.abs(values))
-        loss = mse_loss + reg_param * l1_loss
-        return loss
-
-
-class Conv_AE(nn.Module):
-        def __init__(self, n_features, z_dim, *args, **kwargs):
-            super(Conv_AE, self).__init__(*args, **kwargs)
-            self.q_z_mid_dim = 2000
-            self.q_z_output_dim = 72128
-            # Encoder
-            # Conv Layers
-            self.q_z_conv = nn.Sequential(
-                  nn.Conv2d(1, 8, kernel_size=(2,5), stride=(1), padding=(1)),
-                  #nn.BatchNorm2d(8),
-                  nn.ReLU(),
-                  nn.Conv2d(8, 16, kernel_size=(3), stride=(1), padding=(1)),
-                  nn.BatchNorm2d(16),
-                  nn.ReLU(),
-                  nn.Conv2d(16, 32, kernel_size=(3), stride=(1), padding=(0)),
-                  #nn.BatchNorm2d(32),
-                  nn.ReLU()
-                  ) 
-            # Flatten
-            self.flatten = nn.Flatten(start_dim=1)
-            # Linear layers
-            self.q_z_lin = nn.Sequential( 
-                  nn.Linear(self.q_z_output_dim, self.q_z_mid_dim), 
-                  nn.ReLU(), 
-                  # nn.BatchNorm1d(self.q_z_output_dim),
-                  nn.Linear(self.q_z_mid_dim, z_dim),
-                  nn.ReLU(),
-                  )
-
-            # Decoder
-            self.p_x_lin = nn.Sequential(
-                  nn.Linear(z_dim, self.q_z_mid_dim),
-                  nn.ReLU(),
-                  # nn.BatchNorm1d(self.q_z_output_dim),
-                  nn.Linear(self.q_z_mid_dim, self.q_z_output_dim),
-                  nn.ReLU(),
-                  # nn.BatchNorm1d(42720) 
-                  )
-            # Conv Layers
-            self.p_x_conv = nn.Sequential(
-                  nn.ConvTranspose2d(32, 16, kernel_size=(3), stride=(1), padding=(0)),
-                  nn.BatchNorm2d(16),
-                  nn.ReLU(),
-                  nn.ConvTranspose2d(16, 8, kernel_size=(3), stride=(1), padding=(1)),
-                  nn.BatchNorm2d(8),
-                  nn.ReLU(),
-                  nn.ConvTranspose2d(8, 1, kernel_size=(2,5), stride=(1), padding=(1))
-                  ) 
-    
-        def encode(self, x):
-            # Conv
-            out = self.q_z_conv(x)
-            # flatten
-            out = self.flatten(out)
-            #out = out.view(out.size(0), -1)
-            # dense 
-            out = self.q_z_lin(out)
-            return out
-    
-        def decode(self, z):
-            # dense
-            out = self.p_x_lin(z)
-            # reshape
-            out = out.view(out.size(0), 32, 49, 46)  
-            # DeConv/UnConv?
-            out = self.p_x_conv(out)
-            return out
-        
-        def forward(self, x):
-            z = self.encode(x)
-            out = self.decode(z)
-            return out
diff --git a/projects/example_LHCb/compressed_output/.gitkeep b/projects/example_LHCb/compressed_output/.gitkeep
deleted file mode 100644
index e69de29b..00000000
diff --git a/projects/example_LHCb/decompressed_output/.gitkeep b/projects/example_LHCb/decompressed_output/.gitkeep
deleted file mode 100644
index e69de29b..00000000
diff --git a/projects/example_LHCb/example_LHCb_analysis.py b/projects/example_LHCb/example_LHCb_analysis.py
deleted file mode 100644
index 71667cbf..00000000
--- a/projects/example_LHCb/example_LHCb_analysis.py
+++ /dev/null
@@ -1,185 +0,0 @@
-import uproot
-import pandas as pd
-import pickle
-import numpy as np
-import matplotlib.pyplot as plt
-from matplotlib.backends.backend_pdf import PdfPages
-import scipy.optimize as opt
-
-
-def create_branches(df):
-    K_mass = 0.494
-    df["H1_E"] = np.sqrt(
-        df["H1_PX"] ** 2 + df["H1_PY"] ** 2 + df["H1_PZ"] ** 2 + K_mass**2
-    )
-    df["H2_E"] = np.sqrt(
-        df["H2_PX"] ** 2 + df["H2_PY"] ** 2 + df["H2_PZ"] ** 2 + K_mass**2
-    )
-    df["H3_E"] = np.sqrt(
-        df["H3_PX"] ** 2 + df["H3_PY"] ** 2 + df["H3_PZ"] ** 2 + K_mass**2
-    )
-    df["B_mass"] = np.sqrt(
-        (df["H1_E"] + df["H2_E"] + df["H3_E"]) ** 2
-        - (df["H1_PX"] + df["H2_PX"] + df["H3_PX"]) ** 2
-        - (df["H1_PY"] + df["H2_PY"] + df["H3_PY"]) ** 2
-        - (df["H1_PZ"] + df["H2_PZ"] + df["H3_PZ"]) ** 2
-    )
-
-
-def fit(x, a, b, c, k):
-    return a * np.exp(-((x - b) ** 2) / (2 * c**2)) + k
-
-
-column_names = np.load("./data/example_LHCb/example_LHCb_names.npy")
-
-df_before = pd.DataFrame(
-    np.load("./data/example_LHCb/example_LHCb_data.npy"), columns=column_names
-)
-create_branches(df_before)
-before = df_before["B_mass"]
-df_after = pd.DataFrame(
-    np.load("./projects/example_LHCb/decompressed_output/decompressed.npy"),
-    columns=column_names,
-)
-create_branches(df_after)
-after = df_after["B_mass"]
-
-
-fig, (ax1, ax2) = plt.subplots(
-    2, 1, figsize=(8 * 2.5 * (1 / 2.54), 6 * 2.5 * (1 / 2.54)), sharex=True
-)
-
-x_min = min(before + after)
-x_max = max(before + after)
-x_diff = abs(x_max - x_min)
-
-with PdfPages("./projects/example_LHCb/plotting/analysis.pdf") as pdf:
-
-    # Before Histogram
-    counts_before, bins_before = np.histogram(before, bins=np.linspace(0, 10000, 100))
-    hist1 = ax1.hist(
-        bins_before[:-1],
-        bins_before,
-        weights=counts_before,
-        label="Before",
-        histtype="step",
-        color="black",
-    )
-    before_bin_centers = hist1[1][:-1] + (hist1[1][1:] - hist1[1][:-1]) / 2
-    before_bin_centers_error = (hist1[1][1:] - hist1[1][:-1]) / 2
-    before_bin_counts = hist1[0]
-    before_count_error = np.sqrt(hist1[0])
-    ax1.errorbar(
-        before_bin_centers,
-        before_bin_counts,
-        yerr=before_count_error,
-        xerr=None,
-        marker="",
-        linewidth=0.75,
-        markersize=1,
-        linestyle="",
-        color="black",
-    )
-    optimizedParameters1, pcov1 = opt.curve_fit(
-        fit, before_bin_centers, before_bin_counts, p0=[1, 4500, 1000, 1]
-    )
-    perr1 = np.sqrt(np.diag(pcov1))
-    ax1.plot(
-        before_bin_centers,
-        fit(before_bin_centers, *optimizedParameters1),
-        linewidth=1,
-        label="Fit",
-        color="red",
-    )
-    leg1 = ax1.legend(
-        borderpad=0.5,
-        loc=1,
-        ncol=2,
-        frameon=True,
-        facecolor="white",
-        framealpha=1,
-        fontsize="medium",
-    )
-    leg1._legend_box.align = "left"
-    leg1.set_title(
-        f"Mass  : {round(optimizedParameters1[1],2)} +/- {round(perr1[1],2)}"
-        + f"\nWidth : {round(optimizedParameters1[2],2)} +/- {round(perr1[2],2)}"
-    )
-    ax1.set_ylabel("Counts", fontsize=14, ha="right", y=1.0)
-    ax1.set_xlabel("Mass [GeV]", fontsize=14, ha="right", x=1.0)
-    ax1.set_title("Before Compression")
-    ax1.set_ylim(0, 20000)
-    print(f"Before compression:")
-    print(f"Mass  : {round(optimizedParameters1[1],2)} +/- {round(perr1[1],2)}")
-    print(f"Width : {round(optimizedParameters1[2],2)} +/- {round(perr1[2],2)}")
-
-    # After Histogram
-    counts_after, bins_after = np.histogram(after, bins=np.linspace(0, 10000, 100))
-    hist2 = ax2.hist(
-        bins_after[:-1],
-        bins_after,
-        weights=counts_after,
-        label="After",
-        histtype="step",
-        color="black",
-    )
-    after_bin_centers = hist2[1][:-1] + (hist1[1][1:] - hist1[1][:-1]) / 2
-    after_bin_centers_error = (hist2[1][1:] - hist1[1][:-1]) / 2
-    after_bin_counts = hist2[0]
-    after_count_error = np.sqrt(hist2[0])
-    ax2.errorbar(
-        after_bin_centers,
-        after_bin_counts,
-        yerr=after_count_error,
-        xerr=None,
-        marker="",
-        linewidth=0.75,
-        markersize=1,
-        linestyle="",
-        color="black",
-    )
-    optimizedParameters2, pcov2 = opt.curve_fit(
-        fit, after_bin_centers, after_bin_counts, p0=[1, 4500, 1000, 1]
-    )
-    perr2 = np.sqrt(np.diag(pcov2))
-    ax2.plot(
-        after_bin_centers,
-        fit(after_bin_centers, *optimizedParameters2),
-        linewidth=1,
-        label="Fit",
-        color="red",
-    )
-    leg2 = ax2.legend(
-        borderpad=0.5,
-        loc=1,
-        ncol=2,
-        frameon=True,
-        facecolor="white",
-        framealpha=1,
-        fontsize="medium",
-    )
-    leg2._legend_box.align = "left"
-    leg2.set_title(
-        f"Mass  : {round(optimizedParameters2[1],2)} +/- {round(perr2[1],2)}"
-        + f"\nWidth : {round(optimizedParameters2[2],2)} +/- {round(perr2[2],2)}"
-    )
-    ax2.set_ylabel("Counts", fontsize=14, ha="right", y=1.0)
-    ax2.set_xlabel("Mass [GeV]", fontsize=14, ha="right", x=1.0)
-    ax2.set_title("After Decompression")
-    ax2.set_ylim(0, 20000)
-
-    print(f"After compression:")
-    print(f"Mass  : {round(optimizedParameters2[1],2)} +/- {round(perr2[1],2)}")
-    print(f"Width : {round(optimizedParameters2[2],2)} +/- {round(perr2[2],2)}")
-
-    diff = round(
-        (
-            abs(optimizedParameters1[1] - optimizedParameters2[1])
-            / optimizedParameters2[1]
-        )
-        * 100,
-        1,
-    )
-    fig.suptitle(f"Relative Mass Difference = {diff} %", fontsize=16)
-
-    pdf.savefig()
diff --git a/projects/example_LHCb/example_LHCb_config.py b/projects/example_LHCb/example_LHCb_config.py
deleted file mode 100644
index 11637a28..00000000
--- a/projects/example_LHCb/example_LHCb_config.py
+++ /dev/null
@@ -1,19 +0,0 @@
-def set_config(c):
-    c.data_path = "data/example_LHCb/example_LHCb_data.npy"
-    c.names_path = "data/example_LHCb/example_LHCb_names.npy"
-    c.compression_ratio = 2.0
-    c.energy_conversion = False
-    c.epochs = 20
-    c.early_stopping = True
-    c.lr_scheduler = False
-    c.patience = 100
-    c.min_delta = 0
-    c.model_name = "george_SAE"
-    c.custom_norm = False
-    c.l1 = True
-    c.reg_param = 0.001
-    c.RHO = 0.05
-    c.lr = 0.001
-    c.batch_size = 512
-    c.save_as_root = True
-    c.test_size = 0.15
diff --git a/projects/example_LHCb/example_LHCb_preprocessing.py b/projects/example_LHCb/example_LHCb_preprocessing.py
deleted file mode 100644
index 05ab91b4..00000000
--- a/projects/example_LHCb/example_LHCb_preprocessing.py
+++ /dev/null
@@ -1,16 +0,0 @@
-import uproot
-import numpy as np
-
-# Open pre-Baler data as pandas df
-infile = uproot.open("./data/example_LHCb/example_LHCb.root")["DecayTree"]
-df = infile.arrays(infile.keys(), library="pd")
-
-# Perform PID cuts so we are looking at B->KKK
-df = df[(df.H1_ProbK > 0.5) & (df.H2_ProbK > 0.5) & (df.H3_ProbK > 0.5)].copy()
-
-# Export as pkl file for input to Baler
-names = np.array(list(df.columns))
-data = df.to_numpy()
-
-np.save("./data/example_LHCb/example_LHCb_names.npy", names)
-np.save("./data/example_LHCb/example_LHCb_data.npy", data)
diff --git a/projects/example_LHCb/model/.gitkeep b/projects/example_LHCb/model/.gitkeep
deleted file mode 100644
index e69de29b..00000000
diff --git a/projects/example_LHCb/plotting/.gitkeep b/projects/example_LHCb/plotting/.gitkeep
deleted file mode 100644
index e69de29b..00000000
diff --git a/projects/example_LHCb/training/.gitkeep b/projects/example_LHCb/training/.gitkeep
deleted file mode 100644
index e69de29b..00000000
diff --git a/projects/good_plots/compressed_output/.gitkeep b/projects/good_plots/compressed_output/.gitkeep
deleted file mode 100644
index e69de29b..00000000
diff --git a/projects/good_plots/configClass.py b/projects/good_plots/configClass.py
deleted file mode 100644
index f40704d0..00000000
--- a/projects/good_plots/configClass.py
+++ /dev/null
@@ -1,44 +0,0 @@
-class Configuration(object):
-    def __init__(self):
-        self.input_path = "./data/good_plots/george.pickle"
-
-        self.epochs = 10
-        self.early_stopping = True
-        self.lr_scheduler = False
-        self.patience = 100
-        self.min_delta = 0
-        self.model_name = "george_SAE"
-        self.custom_norm = False
-        self.l1 = True
-        self.reg_param = 0.001
-        self.RHO = 0.05
-        self.lr = 0.001
-        self.batch_size = 512
-        self.save_as_root = True
-        self.cleared_col_names = [
-            "pt",
-            "eta",
-            "phi",
-            "m",
-            "EmEnergy",
-            "HadEnergy",
-            "InvisEnergy",
-            "AuxilEnergy",
-        ]
-        self.test_size = 0.15
-        self.Branch = "Events"
-        self.Collection = "recoGenJets_slimmedGenJets__PAT."
-        self.Objects = "recoGenJets_slimmedGenJets__PAT.obj"
-        self.number_of_columns = 24
-        self.latent_space_size = 15
-        self.dropped_variables = [
-            "recoGenJets_slimmedGenJets__PAT.obj.m_state.vertex_.fCoordinates.fX",
-            "recoGenJets_slimmedGenJets__PAT.obj.m_state.vertex_.fCoordinates.fY",
-            "recoGenJets_slimmedGenJets__PAT.obj.m_state.vertex_.fCoordinates.fZ",
-            "recoGenJets_slimmedGenJets__PAT.obj.m_state.qx3_",
-            "recoGenJets_slimmedGenJets__PAT.obj.m_state.pdgId_",
-            "recoGenJets_slimmedGenJets__PAT.obj.m_state.status_",
-            "recoGenJets_slimmedGenJets__PAT.obj.mJetArea",
-            "recoGenJets_slimmedGenJets__PAT.obj.mPileupEnergy",
-            "recoGenJets_slimmedGenJets__PAT.obj.mPassNumber",
-        ]
diff --git a/projects/good_plots/decompressed_output/.gitkeep b/projects/good_plots/decompressed_output/.gitkeep
deleted file mode 100644
index e69de29b..00000000
diff --git a/projects/good_plots/model/.gitkeep b/projects/good_plots/model/.gitkeep
deleted file mode 100644
index e69de29b..00000000
diff --git a/projects/good_plots/plotting/.gitkeep b/projects/good_plots/plotting/.gitkeep
deleted file mode 100644
index e69de29b..00000000
diff --git a/projects/good_plots/training/.gitkeep b/projects/good_plots/training/.gitkeep
deleted file mode 100644
index e69de29b..00000000


Test patch:
diff --git a/tests/test_data_processing.py b/tests/test_data_processing.py
index 7fe3e948..1cfc479e 100644
--- a/tests/test_data_processing.py
+++ b/tests/test_data_processing.py
@@ -1,3 +1,17 @@
+# Copyright 2022 Baler Contributors
+
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+
+#     http://www.apache.org/licenses/LICENSE-2.0
+
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
 import os
 
 import numpy as np
diff --git a/tests/test_helper.py b/tests/test_helper.py
index 697f169d..4a9618b2 100644
--- a/tests/test_helper.py
+++ b/tests/test_helper.py
@@ -1,3 +1,17 @@
+# Copyright 2022 Baler Contributors
+
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+
+#     http://www.apache.org/licenses/LICENSE-2.0
+
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
 import os
 import shutil