Skip to content

Instantly share code, notes, and snippets.

View metacritical's full-sized avatar
🔁
ML Training Loop

Pankaj Doharey metacritical

🔁
ML Training Loop
View GitHub Profile
@metacritical
metacritical / Preview.md
Last active January 6, 2024 12:17
Simple Mail Catcher for rails.

Preview

Screenshot 2024-01-06 at 5 28 52 PM
@metacritical
metacritical / emacsclient.c
Created December 7, 2023 09:36
Test emaclient
/* Client process that communicates with GNU Emacs acting as server.
Copyright (C) 1986-2023 Free Software Foundation, Inc.
This file is part of GNU Emacs.
GNU Emacs is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or (at
your option) any later version.
@metacritical
metacritical / Tiny_corp_master_plan.md
Last active December 2, 2023 18:01
Tiny corp master plan - By George Hotz (This gist exists purely for accessibility purposes)

Tiny corp master plan

Our mission is to “commoditize the petaflop.” By building an ML framework where the engineering cost to add a new accelerator is 10-100x lower than competitors, we lower the cost for new players to enter the market.

Similarly, we lower the cost of new operations and optimizers, allowing ML to avoid local minima. In older versions of PyTorch, batchnorm and groupnorm have very different performance. There’s no fundamental reason for this, it was just because more work had been put into the batchnorm kernels. In tinygrad, all the kernels are compiled on the fly so things like this won’t happen.

@metacritical
metacritical / tdee.rb
Created November 15, 2023 15:27
Total Daily Energy Expenditure script
#!/usr/bin/env ruby
# Function to calculate BMR
def calculate_bmr(gender, weight, height, age)
if gender.downcase == 'male'
return 88.362 + (13.397 * weight) + (4.799 * height) - (5.677 * age)
else
return 447.593 + (9.247 * weight) + (3.098 * height) - (4.330 * age)
end
end
@metacritical
metacritical / Gemfile
Created October 28, 2023 17:56 — forked from dhh/Gemfile
HEY's Gemfile
ruby '2.7.1'
gem 'rails', github: 'rails/rails'
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data
# Action Text
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra'
gem 'okra', github: 'basecamp/okra'
# Drivers
@metacritical
metacritical / Embedding GoLang into a Ruby application.md
Created September 26, 2023 19:15 — forked from schweigert/Embedding GoLang into a Ruby application.md
Embedding GoLang into a Ruby application - Blogpost to Magrathealabs

Go Title

I am passionate about Ruby, but its execution time compared to other languages is extremely high, especially when we want to use more complex algorithms. In general, data structures in interpreted languages become incredibly slow compared to compiled languages. Some algorithms such as ´n-body´ and ´fannkuch-redux´ can be up to 30 times slower in Ruby than Go. This is one of the reasons I was interested in embedding Go code in a Ruby environment.

For those who do not know how shared libraries operate, they work in a similar way as DLLs in Windows. However, they have a native code with a direct interface to the C compiler.

Note Windows uses the DLL system, and in this case, this does not necessarily have to be in native code.

One example is DLLs written in C#, which runs on a virtual machine. Because I do not use windows, I ended up not testing if it is poss

@metacritical
metacritical / Postgres_M2.md
Created August 6, 2023 12:43
Postgres on M2

Installing pg 1.5.3 with native extensions Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

brew install libpq
gem install pg -- --with-pg-config=/usr/local/opt/libpq/bin/pg_config
@metacritical
metacritical / yt_delete_comments.js
Created July 29, 2023 18:35
Delete youtube comments En Masse!
var a = document.getElementsByClassName("VfPpkd-Bz112c-LgbsSe yHy1rc eT1oJ mN1ivc")
var i = 1; while(i <= a.length){ a[i].click(); i+=1 }
@metacritical
metacritical / kandinsky.txt
Created July 14, 2023 23:18 — forked from FurkanGozukara/kandinsky.txt
Save kandinsky generated images
# tutorial video link : https://youtu.be/dYt9xJ7dnpU
# colab link : https://colab.research.google.com/drive/1xSbu-b-EwYd6GdaFPRVgvXBX_mciZ41e?usp=sharing
# repo link : https://github.com/ai-forever/Kandinsky-2
# used repo commit hash : a4354c04d5fbd48851866ef7d84ec444d3d50102
# those who getting cuda error
# pip uninstall torch
# pip3 install torch==1.13.1 torchvision torchaudio --index-url https://download.pytorch.org/whl/cu117
import os
@metacritical
metacritical / Routine_that_works.md
Last active July 10, 2023 16:28
The meal and exercise routine that is working for me.

I am feeling the best i have felt in a long time. I have been experimenting with diet and suppliments. here is my current stack:

Morning:

  • 15g Collagen + 5g Creatine + aloevera juice + 1 lemon
  • Go for a walk + run 1.5 Km + 1.5 Km
  • Some basic resistance band exercises.

Since Aloevera is a laxative the best way to prepare it is first cut the leaf in 2-3 pieces horizontally and let it soak in a lot of water for 4-5 hours. throw away that water before removing the aloe gel. Be careful not to scrape any green stuff and you will have no laxative effect.