Skip to content

Instantly share code, notes, and snippets.

@Arkoniak
Arkoniak / mxnet_loss_linear.jl
Last active January 17, 2017 11:47
Custom loss function in Julia MXNet, linear regression
using MXNet
import MXNet.mx: _update_single_output, reset!, get
using Distributions
#####################################
# Custom evaluation metric
# It just summarize predictions, because in the case of custom
# loss layer, ANN output equals to loss function itself
@jlisic
jlisic / rasterTool.R
Last active June 28, 2017 14:44
Simple tools to use gdal to polygonize and rasterize
library(cdlTools)
library(rgdal)
library(raster)
library(rgeos)
# rasterize in the R 'raster' package is really slow, depending on your needs this may work better
# Author: Jonathan Lisic
# License BSD
polyExtract <- function(x) {
@dalejbarr
dalejbarr / L3_stats_homework_5_2016.R
Created November 4, 2016 12:26
script for video walkthrough on using R/RStudio for 3-way ANOVA
## youtube video: https://youtu.be/AJDo9gpkEcg
library("readr")
library("ggplot2")
## read.csv() <- from base R. DON'T USE!
hw5 <- read_csv("homework_5.csv") # from readr
hw5$A <- factor(hw5$A)
hw5$B <- factor(hw5$B)
hw5$C <- factor(hw5$C)
@cewee
cewee / gist:356b941a4006a502a67f68213f1a76b5
Created August 20, 2018 17:24
Docker py-faster-rcnn and caffe with cuda8
FROM nvidia/cuda:8.0-cudnn6-devel-ubuntu16.04
ENV PACKAGES_ROOT=/opt
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
cmake \
git \
wget \
libatlas-base-dev \
@acmiyaguchi
acmiyaguchi / faster-rcnn-caffe-master.md
Last active March 16, 2020 14:58
py-faster-rcnn on Ubuntu 17.10 and Cuda 9.0
@fabianp
fabianp / svd_memory.py
Created December 10, 2012 14:10
Timings and memory consumption for the singular value decomposition implemented in scipy. The script svd_memory.py generates a plot about the memory consumption (requires the package `memory_profiler`) and the second one will plot the timings. The scripts will perform several iterations for matrices of different sizes and will take about 30 minu…
# .. Memory benchmarks for SciPy's Singular Value Decomposition ..
# .. Author: Fabian Pedregosa <fabian@fseoane.net>
import numpy as np
from scipy.sparse import linalg as splinalg
from scipy import sparse, linalg
import pylab as pl
from memory_profiler import memory_usage
dims = np.arange(500, 1500, 20)
@gjkerns
gjkerns / powerSampleSize.R
Created January 13, 2012 19:30
Simulation for determining sample size in Repeated Measures ANOVA
# Simulation study for sample size between/within
# got Treat + Sham between subjects
# got Time within subjects
nPerGroup <- 30
nTime <- 4
muTreat <- c(37, 32, 20, 15)
muSham <- c(37, 32, 25, 22)
stdevs <- c(12, 10, 8, 6)
stdiff <- 9
@bertbalcaen
bertbalcaen / Extract all frames from a 24 fps movie using ffmpeg
Last active April 6, 2021 09:02
Extract all frames from a 24 fps movie using ffmpeg
ffmpeg -i shame-run.mov -r 24/1 test/output%03d.jpg
@ottokart
ottokart / nn.py
Last active August 27, 2021 05:52
3-layer neural network example with dropout in 2nd layer
# Tiny example of 3-layer nerual network with dropout in 2nd hidden layer
# Output layer is linear with L2 cost (regression model)
# Hidden layer activation is tanh
import numpy as np
n_epochs = 100
n_samples = 100
n_in = 10
n_hidden = 5
@wookietreiber
wookietreiber / README.md
Last active December 20, 2022 14:00
R - Command Line Interface (CLI) and RStudio - template

R - Interactive Sessions and Command Line Interface

This is a template for R projects that should work both on the command line as well as in an interactive session.

Template Files

The template is made up of three files:

  1. foo.r