Skip to content

Instantly share code, notes, and snippets.

@kumar-abhishek
kumar-abhishek / NLL_OHEM.py
Created January 29, 2023 21:02 — forked from erogol/NLL_OHEM.py
Online hard example mining PyTorch
import torch as th
class NLL_OHEM(th.nn.NLLLoss):
""" Online hard example mining.
Needs input from nn.LogSotmax() """
def __init__(self, ratio):
super(NLL_OHEM, self).__init__(None, True)
self.ratio = ratio
@kumar-abhishek
kumar-abhishek / amqdn-crl.ipynb
Created July 26, 2022 14:17 — forked from amqdn/amqdn-crl.ipynb
Implementing Class Rectification Loss in fast.ai
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kumar-abhishek
kumar-abhishek / app.js
Created March 17, 2019 00:10 — forked from daffl/app.js
Basic service layer
class ChatApplication {
login (username, password) {},
logout (user) {},
joinChatRoom(roomId, user) {}
sendMessage(message, roomId, user) {}
sendPrivateMessage(message, receiverId, user) {}
@kumar-abhishek
kumar-abhishek / System Design.md
Created April 18, 2018 21:04 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@kumar-abhishek
kumar-abhishek / about.md
Created July 6, 2017 18:12 — forked from jasonrudolph/about.md
Programming Achievements: How to Level Up as a Developer

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

"""
This file contains code that, when run on Python 2.7.5 or earlier, creates
a string that should not exist: u'\Udeadbeef'. That's a single "character"
that's illegal in Python because it's outside the valid Unicode range.
It then uses it to crash various things in the Python standard library and
corrupt a database.
On Python 3... well, this file is full of syntax errors on Python 3. But
if you were to change the print statements and byte literals and stuff:
@kumar-abhishek
kumar-abhishek / gist:1546168
Created January 1, 2012 03:41 — forked from theabraham/gist:1307910
JavaScript Resources

Google is the ultimate tool if you want to learn something new, but this link-fest is made up of some of my favorite bookmarks on JavaScript; there's a lot of reading to do!

Also, feel free to email me at xbrxhxmxlrxjhi@gmail.com (replace x's with a's) if you have any questions.

JavaScript