Skip to content

Instantly share code, notes, and snippets.

View TrigonaMinima's full-sized avatar

Shivam Rana TrigonaMinima

View GitHub Profile
@TrigonaMinima
TrigonaMinima / gcp_create_instance.sh
Created March 13, 2019 17:12
Scripts to automate parts of GCP instance management
#!/bin/bash
export PROJECT_NAME="your_project_name"
echo "Selected project - "$PROJECT_NAME
gcloud config set project $PROJECT_NAME
export IMAGE_FAMILY="pytorch-latest-gpu" # or "pytorch-latest-cpu" for non-GPU instances
export ZONE="us-west2-b" # budget: "us-west1-b"
export INSTANCE_NAME="your-instance-name"
export INSTANCE_TYPE="n1-highmem-8" # budget: "n1-highmem-4"
@TrigonaMinima
TrigonaMinima / min-char-rnn.py
Created June 6, 2018 10:36 — forked from karpathy/min-char-rnn.py
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)

I was watching an interview of the most famous criminal lawyer of my country. He raised a family of four, they all became lawyer too. The lawyer, in his post-war lifetime, became wildly successful in defending criminals on the edge of society; Gypsies, high-profile criminals, et cetera. In this interview, he was asked what a good justice system would look like. His reply was that real justice would involve a large factor of "making things right" for the victims. Not just pointless punishment (while punishment was certainly a factor he'd see in the system), but focused towards "making things right". If you steal, pay back the stolen goods manyfold. If you sexually abuse, do time in help centers to assist victims (obviously well-supervised). If you kill, help the family financially and do time in aftercare.

The whole focus on justice in his point of view should be to ease the burden of the act for the family/society afterwards. To me this is a really great view of fixing any wrongdoing. I hope Promise will foc

@TrigonaMinima
TrigonaMinima / memory_techniques.md
Created February 13, 2018 07:15
Memory Techniques

Towards total recall

If you are interested in further, low-effort ways to boost your recall, you may benefit from the following strategies:

  • Just dim the lights, sit back, and enjoy 10-15 minutes of quiet contemplation, and you’ll find that your memory of the facts you have just learnt is far better than if you had attempted to use that moment more productively.
  • Test yourself. So-called “retrieval practice” – actively forcing yourself to remember information – is far more effective than passive reading.
  • “Space” your studies, leaving a few weeks between the times you revisit material. Indeed, it’s often better to wait until you are on the cusp of forgetting the material to avoid “overlearning”.
  • Talk to yourself. Simple describing an event cements it in your memory.
  • Add variety. It can sometimes be beneficial to mix up and rotate the subjects you are studying, a process called “interleaving”, rather than studying each one in a single block.
# http://signal-to-noise.xyz/post/bk-tree/
# to search nearest-neighbors of a query from the "metric space".
# distance should fulfill the 4 axioms of a metric.
from collections import deque
class BKTree:
def __init__(self, distance_func):
self._tree = None