Skip to content

Instantly share code, notes, and snippets.

View MuhammadShifa's full-sized avatar
🎯
Focusing

Muhammad Shifa MuhammadShifa

🎯
Focusing
View GitHub Profile
@joreilly86
joreilly86 / 061-pytorch_beam_example.py
Last active January 26, 2026 03:06
ML for Structural Beam Design: PyTorch example comparing linear and non-linear neural networks to traditional bending moment calculations for steel beam depth. Demonstrates augmenting engineering formulas with data-driven learning. (Flocode Newsletter #062)
"""
Flocode Newsletter #062 - Machine Learning for Engineers: When and How Should We Use it?
This script demonstrates a simple application of machine learning (ML) to a
structural engineering problem: predicting the required depth of a steel beam
based on its span and applied uniformly distributed load (UDL). It compares
three ML models (linear, non-linear, and deep non-linear neural networks)
with a traditional calculation based on the bending moment formula.
The key concept is that the ML models are trained on data *derived* from the
@juanmc2005
juanmc2005 / diart_whisper.py
Last active November 26, 2025 07:29
Code for my tutorial "Color Your Captions: Streamlining Live Transcriptions with Diart and OpenAI's Whisper". Available at https://medium.com/@juanmc2005/color-your-captions-streamlining-live-transcriptions-with-diart-and-openais-whisper-6203350234ef
import logging
import os
import sys
import traceback
from contextlib import contextmanager
import diart.operators as dops
import numpy as np
import rich
import rx.operators as ops
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.