This file contains hidden or 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
| require 'torch' | |
| require 'cutorch' | |
| require 'nn' | |
| require 'cunn' | |
| require 'cudnn' | |
| local N = 32 | |
| local cin = 64 | |
| local cout = 64 | |
| local height = 256 |
This file contains hidden or 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
| cunn forward took 0.048157 +- 0.016924 [0.000000, 0.053959] | |
| cunn backward took 0.197217 += 0.069304 [0.000000, 0.220502] | |
| MM forward took 0.048390 +- 0.017005 [0.000000, 0.054137] | |
| MM backward took 0.198168 += 0.069635 [0.000000, 0.221254] | |
| cudnn forward took 0.063036 +- 0.022154 [0.000000, 0.070827] | |
| cudnn backward took 0.240987 += 0.084703 [0.000000, 0.272077] |
This file contains hidden or 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
| require 'torch' | |
| require 'cutorch' | |
| require 'nn' | |
| require 'cunn' | |
| require 'cudnn' | |
| require 'loadcaffe' | |
| local cmd = torch.CmdLine() | |
| cmd:option('-model', 'alexnet') | |
| cmd:option('-backend', 'nn') |
This file contains hidden or 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
| require 'nn' | |
| local times_two, parent = torch.class('nn.TimesTwo', 'nn.Module') | |
| function times_two:__init() | |
| parent.__init(self) | |
| end | |
This file contains hidden or 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
| $(function() { | |
| var SERVER_URL = null; | |
| var video_active = false; | |
| var demo_running = false; | |
| var NUM_TO_SHOW = 20; | |
| var IMAGE_DISPLAY_WIDTH = 800; | |
| var BOX_LINE_WIDTH = 6; |
This file contains hidden or 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 argparse, random, os, time, json | |
| from PIL import Image | |
| from io import BytesIO | |
| import base64 | |
| from flask import Flask, request | |
| from flask.ext.cors import CORS | |
| from flask_restful import Resource, Api |
This file contains hidden or 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
| require 'nn' | |
| require 'cutorch' | |
| require 'cunn' | |
| --[[ | |
| -- A simple benchmark comparing fully-connected net times on CPU and GPU. | |
| -- | |
| -- Note that we don't count time it takes to transfer data to the GPU. | |
| --]] |
This file contains hidden or 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
| 1 0.00348258706468 | |
| 2 0.00497760079642 | |
| 3 0.00846613545817 | |
| 4 0.028898854011 | |
| 5 0.0827517447657 | |
| 6 0.17506234414 | |
| 7 0.318862275449 | |
| 8 0.478781827259 | |
| 9 0.627372627373 | |
| 10 0.752123938031 |
This file contains hidden or 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
| require 'torch' | |
| require 'nn' | |
| require 'cutorch' | |
| require 'cunn' | |
| require 'cudnn' | |
| require 'optim' | |
| require 'hdf5' | |
| require 'image' | |
This file contains hidden or 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 argparse, os, glob, tempfile | |
| import h5py | |
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| from scipy.misc import imread, imresize | |
| # Stupid workaround for some messed up images | |
| from PIL import ImageFile | |
| ImageFile.LOAD_TRUNCATED_IMAGES = True |
OlderNewer