start new:
tmux
start new with session name:
tmux new -s myname
| num_processes = 2 | |
| batch_size = 1000 | |
| threads_per_process = 10 | |
| Parallel.map(0...num_processes, :in_processes => num_processes) do |i|· | |
| User.connection.reconnect! | |
| User.find_in_batches(:batch_size => batch_size,· | |
| :start => (User.count/num_processes) * i,· | |
| :conditions => ["id <= ?", (User.count/num_processes)*(i+1)]) do |batch|· | |
| Parallel.map(batch, :in_threads => threads_per_process) do |record| |
| ;; 訓練データ | |
| (def text_classified_p '(["good" "bad" "good" "good"] | |
| ["exciting" "exciting"] | |
| ["good" "good" "exciting" "boring"])) | |
| (def text_classified_n '(["bad" "boring" "boring" "boring"] | |
| ["bad" "good" "bad"] | |
| ["bad" "bad" "boring" "exciting"])) | |
| ;;多変数ベルヌーイモデル | |
| (defn train [features] |
| #!/usr/bin/env sh | |
| ## | |
| # This is script with usefull tips taken from: | |
| # https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
| # | |
| # install it: | |
| # curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
| # |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| {url:'stun:stun01.sipphone.com'}, | |
| {url:'stun:stun.ekiga.net'}, | |
| {url:'stun:stun.fwdnet.net'}, | |
| {url:'stun:stun.ideasip.com'}, | |
| {url:'stun:stun.iptel.org'}, | |
| {url:'stun:stun.rixtelecom.se'}, | |
| {url:'stun:stun.schlund.de'}, | |
| {url:'stun:stun.l.google.com:19302'}, | |
| {url:'stun:stun1.l.google.com:19302'}, | |
| {url:'stun:stun2.l.google.com:19302'}, |
| # Call scopes directly from your URL params: | |
| # | |
| # @products = Product.filter(params.slice(:status, :location, :starts_with)) | |
| module Filterable | |
| extend ActiveSupport::Concern | |
| module ClassMethods | |
| # Call the class methods with names based on the keys in <tt>filtering_params</tt> | |
| # with their associated values. For example, "{ status: 'delayed' }" would call |
| """ | |
| 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) |
| #!/bin/bash | |
| # Run this on This AMI on AWS: | |
| # https://console.aws.amazon.com/ec2/v2/home?region=us-east-1#LaunchInstanceWizard:ami=ami-b36981d8 | |
| # You should get yourself a fully working GPU enabled tensorflow installation. | |
| cd ~ | |
| # grab cuda 7.0 |
| {0: 'tench, Tinca tinca', | |
| 1: 'goldfish, Carassius auratus', | |
| 2: 'great white shark, white shark, man-eater, man-eating shark, Carcharodon carcharias', | |
| 3: 'tiger shark, Galeocerdo cuvieri', | |
| 4: 'hammerhead, hammerhead shark', | |
| 5: 'electric ray, crampfish, numbfish, torpedo', | |
| 6: 'stingray', | |
| 7: 'cock', | |
| 8: 'hen', | |
| 9: 'ostrich, Struthio camelus', |