Skip to content

Instantly share code, notes, and snippets.


Eugenio Culurciello culurciello

View GitHub Profile
View pytorchcheat.txt
View pytorch failure Titan X (Maxwell)
elab@gpu5 ~/pytorch-examples/imagenet [master*]$ python3 -a alexnet /media/SuperSSD/test-dataset-train-val/
=> creating model 'alexnet'
Traceback (most recent call last):
File "", line 286, in <module>
File "", line 129, in main
train(train_loader, model, criterion, optimizer, epoch)
File "", line 165, in train
output = model(input_var)
File "/usr/local/lib/python3.4/dist-packages/torch/nn/modules/", line 210, in __call__
View table-test.lua
-- E. Culurciello, November 2016
-- test to see if table insert/remove is slower than table addressing
iters = 1e5
tablesize = 1e4
item = torch.randn(iters,1024)
View xception.lua
-- Xception model
-- a Torch7 implementation of:
-- E. Culurciello, October 2016
require 'nn'
local nClasses = 1000
function nn.SpatialSeparableConvolution(nInputPlane, nOutputPlane, kW, kH)
local block = nn.Sequential()
block:add(nn.SpatialConvolutionMap(nn.tables.oneToOne(nInputPlane), kW,kH, 1,1, 1,1))
#! /usr/bin/env python3
# E. Culurciello, example of reinforcement learning in Python
# Game: 5 rooms connected through doors. One room is the goal-room.
# the goal of the game is to get to the goal-room
import numpy as np
# this is how rooms are connected:
View recurrent-multilayer.lua
-- Eugenio Culurciello
-- August 2016
-- a test to learn to code PredNet-like nets in Torch7
require 'nn'
require 'nngraph'
View LineSegmentCetector.lua
local cv = require 'cv'
require 'cv.highgui'
require 'cv.imgproc'
require 'cv.imgcodecs'
require 'image'
-- local image = cv.imread{arg[1] or 'demo/lena.jpg', cv.IMREAD_GRAYSCALE}
imgT = image.lena()
imgT = image.lena()
imgTg = imgT[2] -- convert to grayscale and remove the first dimension
View ffmpeg.rtf
to resize 1080p videos:
ffmpeg -i pool.mp4 -vf scale=640:360 pool-small.mp4
to match odroid fps (12fps): need to speed up video:
ffmpeg -i dog.mp4 -vf scale=640:360 -filter:v "setpts=0.5*PTS" dog-2x.mp4
because it does not scale with this command, so we need to do more:
You can’t perform that action at this time.