Code for: Kraišniković, C., Stathopoulos, S., Prodromakis, T., & Legenstein, R. (2023, March). Fault pruning: Robust training of neural networks with memristive weights. In International Conference on Unconventional Computation and Natural Computation (pp. 124-139). Cham: Springer Nature Switzerland.