This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
type Reducer<State, Action, Effect> = ( | |
state: State, | |
action: Action | |
) => [State, Effect]; | |
type EffectHandler<Effect, Action> = (effect: Effect) => Promise<void | Action>; | |
type StateWithEffect<State, Effect> = [State, Effect]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
description = "activity watch"; | |
inputs = { | |
# for building rust apps | |
naersk = { | |
url = "github:nmattia/naersk"; | |
inputs.nixpkgs.follows = "nixpkgs"; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::collections::hash_map::HashMap; | |
/// Cacher can cache function calls of one argument | |
pub struct Cacher<Computation, Input, Output> | |
where | |
Computation: Fn(Input) -> Output, | |
Input: std::cmp::Eq + std::hash::Hash, | |
Output: std::clone::Clone, | |
Input: std::clone::Clone, | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Updated/fixed version from Gene Kogan's "machine learning for artists" collection - ml4a.github.io | |
import time | |
import os | |
import re | |
import random | |
import argparse | |
import urllib.request | |
import itertools | |
import bs4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import print_function | |
import os | |
import math | |
import torch | |
import argparse | |
import numpy as np | |
import torch.nn as nn | |
import torch.optim as optim | |
import torch.legacy.nn as lnn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ================================================================== | |
# module list | |
# ------------------------------------------------------------------ | |
# torch latest (git) | |
# ================================================================== | |
APT_INSTALL="apt-get install -y --no-install-recommends" && \ | |
PIP_INSTALL="python -m pip --no-cache-dir install --upgrade" && \ | |
GIT_CLONE="git clone --depth 10" && \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e | |
###################################################################### | |
# This script installs required dependencies for Torch7 | |
###################################################################### | |
{ | |
install_openblas() { | |
# Get and build OpenBlas (Torch is much better with a decent Blas) |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.