Skip to content

Instantly share code, notes, and snippets.

@anirudhshenoy
anirudhshenoy / final_code.py
Created December 13, 2019 12:27
Code for the Blog at:
from torch import nn
from time import time
import torch
import numpy as np
import matplotlib.pyplot as plt
from tqdm import tqdm
from skimage.util.shape import view_as_windows
torch.manual_seed(42)
@Tushar-N
Tushar-N / hook_activations.py
Created August 3, 2018 00:06
Pytorch code to save activations for specific layers over an entire dataset
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision.models as tmodels
from functools import partial
import collections
# dummy data: 10 batches of images with batch size 16
dataset = [torch.rand(16,3,224,224).cuda() for _ in range(10)]
@siliconvallaeys
siliconvallaeys / Manage Stacked or Tiered Keyword Bids.js
Last active April 24, 2019 06:31
Helps find when your stacked bids by match type are not following your stratregy
/*
// AdWords Script: Check and set keyword bids for stacked (tiered) bid strategy
// -----------------------------------------------------------------------------
// Copyright 2017 Optmyzr Inc., All Rights Reserved
//
// This script helps you compare bids for the same keyword in multiple match types
// It can output just keywords for which a less restrictive match type has equal or higher bids (mode 1)
// or it can output all keywords so you can see the bids by match type (mode 2)
//
// New bids can be generated and uploaded with the spreadsheet through Bulk Uploads. The file is NOT compatible with AdWords Editor.
@GaelVaroquaux
GaelVaroquaux / mutual_info.py
Last active June 18, 2023 12:25
Estimating entropy and mutual information with scikit-learn: visit https://github.com/mutualinfo/mutual_info
'''
Non-parametric computation of entropy and mutual-information
Adapted by G Varoquaux for code created by R Brette, itself
from several papers (see in the code).
This code is maintained at https://github.com/mutualinfo/mutual_info
Please download the latest code there, to have improvements and
bug fixes.
@zmjones
zmjones / parses3logs.py
Created February 7, 2014 13:53
parse and clean log files from AWS S3
import csv
import os
import re
import dateutil
import pandas as pd
from urlparse import urlparse
log_path = ''
# parsing code: http://ferrouswheel.me/2010/01/python_tparse-fields-in-s3-logs/
log_entries = []