Skip to content

Instantly share code, notes, and snippets.

View mrchypark's full-sized avatar

ChanYub Park mrchypark

View GitHub Profile
@leoh0
leoh0 / README.md
Last active August 16, 2018 23:12
Use docker hub as a public accessible storage when you need to upload and download large file for free.

docker_as_a_storage

Upload with docker, download with only curl.

  1. upload your file
REPO=YOUR_DOCKER_ID ./docker_as_a_storage.sh <file or directory>
@markheckmann
markheckmann / remove_password_excel.R
Last active February 4, 2022 05:27
Remove sheet's password protection in Excel
# remove sheet protection in Excel
# Sample file: https://www.dropbox.com/s/4ul0kowrscyr8cz/excel_protected.xlsx?dl=0
library(stringr)
library(zip)
# file with protected sheets
file <- "data/excel_protected.xlsx"
# file name and path after removing protection
@ashokpant
ashokpant / cuda_9.0_cudnn_7.0.sh
Last active October 15, 2024 08:56
Install CUDA Toolkit v9.0 and cuDNN v7.0 on Ubuntu 16.04
#!/bin/bash
# install CUDA Toolkit v9.0
# instructions from https://developer.nvidia.com/cuda-downloads (linux -> x86_64 -> Ubuntu -> 16.04 -> deb)
CUDA_REPO_PKG="cuda-repo-ubuntu1604-9-0-local_9.0.176-1_amd64-deb"
wget https://developer.nvidia.com/compute/cuda/9.0/Prod/local_installers/${CUDA_REPO_PKG}
sudo dpkg -i ${CUDA_REPO_PKG}
sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/7fa2af80.pub
sudo apt-get update
sudo apt-get -y install cuda-9-0
@mingrammer
mingrammer / download-csv-from-browser.js
Last active November 28, 2024 12:12
Download CSV files directly from your browser
function createCSV(data) {
var lineDelimiter = '\n';
var csv = {
'title': '',
'head': '',
'body': ''
};
csv.title = 'csv-title.csv';
csv.head = '...'; // make your own csv head
@CodingDoug
CodingDoug / README.md
Last active August 3, 2023 16:41
Copying Data from a Google Sheet into Firebase Realtime Database in real time via Apps Script
@alexellis
alexellis / k8s-pi.md
Last active December 13, 2024 23:24
K8s on Raspbian
@strarsis
strarsis / docker-on-wsl-windows-10-home-docker-toolbox.md
Last active September 4, 2023 07:29
Notes about Docker on WSL (Windows 10 Home / Docker Toolbox) (Virtualbox instead Hyper-V)

Edit (September 2020):

A Tour of PyTorch Internals (Part I)

The fundamental unit in PyTorch is the Tensor. This post will serve as an overview for how we implement Tensors in PyTorch, such that the user can interact with it from the Python shell. In particular, we want to answer four main questions:

  1. How does PyTorch extend the Python interpreter to define a Tensor type that can be manipulated from Python code?
  2. How does PyTorch wrap the C libraries that actually define the Tensor's properties and methods?
  3. How does PyTorch cwrap work to generate code for Tensor methods?
  4. How does PyTorch's build system take all of these components to compile and generate a workable application?

Extending the Python Interpreter

PyTorch defines a new package torch. In this post we will consider the ._C module. This module is known as an "extension module" - a Python module written in C. Such modules allow us to define new built-in object types (e.g. the Tensor) and to call C/C++ functions.

@brandonrobertz
brandonrobertz / keras_fasttext_skipgram_embedding.py
Last active October 9, 2018 09:29
Keras Skipgram Embedding (using pretrained FastText vectors)
# coding: utf-8
from __future__ import print_function
import numpy as np
from keras.models import Sequential
from keras.layers import Embedding
window_size = 1
# using skipgram embeddings built using fasttext:
# fasttext skipgram -input dataset -output dataset.skipgram