Open Closed Principle for Machine Learning Engineers: Theory and Practice @ValerioVelardoTheSoundofAI
Open Closed Principle for Machine Learning Engineers: Theory and Practice  @ValerioVelardoTheSoundofAI
Uploaded September 2021 | Updated September 2026, 2 weeks ago
When a class in your Machine Learning code knows too much about its dependencies, you have a problem. You are not adhering to the Open-Closed Principle (‘O’ in the SOLID principles).

Your code will be tightly coupled and difficult to test in isolation.

Learn about the Open-Closed Principle, how to spot its violations, and how you can refactor ML code to respect it.

By adhering to OCP, your ML code will be cleaner and more maintainable in the longer run.

Slides:
github.com/musikalkemist/solidforml/blob/main/solidforml/03%20Open%20Closed%20Principle/Open%20Closed%20Principle.pdf

Code:
github.com/musikalkemist/solidforml/blob/main/solidforml/03%20Open%20Closed%20Principle/openclosed.py

===============================

Interested in hiring me as a consultant/freelancer?
valeriovelardo.com

Join The Sound Of AI Slack community:
valeriovelardo.com/the-sound-of-ai-community

Connect with Valerio on Linkedin:
linkedin.com/in/valeriovelardo

Follow Valerio on Facebook:
facebook.com/TheSoundOfAI

Follow Valerio on Twitter:
twitter.com/musikalkemist​

===============================

Content:
0:00 Intro
0:21 Open-Closed Principle definition
1:20 OCP violation problems
1:57 How to spot OCP violations
2:34 Introducing the Python example
5:08 Why the example violates OCP
8:26 Solving the OCP violation
9:51 Refactoring the code
14:32 Outro
Open Closed Principle for Machine Learning Engineers: Theory and PracticeExtracting Mel Spectrograms with PythonHow to Implement Autoencoders in Python and Keras || The EncoderHow to Select AI (Audio) Papers EffectivelyTraining a VAE with Speech Data in KerasSaving the Autoencoder in Keras5 Things I Wish I Knew when I Founded my AI Music Company12.  Melody Generation with Markov Chains - Generative Music AIPreparing the Speech DatasetThe Secrets to Fail/Succeed Building a Machine Learning Solution7 Real-World AI Audio Applications6. Symbolic Vs Audio Generation - Generative Music AI
Valerio Velardo - The Sound of AI |

Open Closed Principle for Machine Learning Engineers: Theory and Practice

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER