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
# E. Culurciello, February 2024 | |
# generated with Gemini: | |
# generate a python script that can recursively parse a directory of files with specific files extensions and copy all the files into a text string. Must be able to take as argument the directory string, and must have a variable to specify multiple file extensions. It should save the text file as prompt.txt | |
# run as: python github2llm.py my_dir/ "swift,json,xcodeproj,plist" | |
import os | |
import sys | |
def parse_directory(directory, extensions): |
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
#!/bin/bash | |
# Script: my-pi-temp.sh | |
# Purpose: Display the ARM CPU and GPU temperature of Raspberry Pi | |
# ------------------------------------------------------- | |
cpu=$(</sys/class/thermal/thermal_zone0/temp) | |
echo "--- Measure Raspberry Pi CPU and GPU temperature ---" | |
echo "$(date) @ $(hostname)" | |
echo "-------------------------------------------" | |
echo "GPU $(vcgencmd measure_temp)" | |
echo "CPU temp=$((cpu/1000))'C" |
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
<?xml version="1.0"?> | |
<robot name="visual"> | |
<!-- E. Culurciello, March 2021 --> | |
<!-- basic 2-fingers gripper --> | |
<link name="base"> | |
<inertial> | |
<mass value="1"/> | |
<inertia ixx="100" ixy="0" ixz="0" iyy="100" iyz="0" izz="100" /> | |
<origin/> | |
</inertial> |
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
http://pytorch.org/ | |
https://discuss.pytorch.org/ | |
https://github.com/pytorch/ | |
https://github.com/bfortuner/pytorch-cheatsheet/blob/master/pytorch-cheatsheet.ipynb |
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
elab@gpu5 ~/pytorch-examples/imagenet [master*]$ python3 main.py -a alexnet /media/SuperSSD/test-dataset-train-val/ | |
=> creating model 'alexnet' | |
Traceback (most recent call last): | |
File "main.py", line 286, in <module> | |
main() | |
File "main.py", line 129, in main | |
train(train_loader, model, criterion, optimizer, epoch) | |
File "main.py", line 165, in train | |
output = model(input_var) | |
File "/usr/local/lib/python3.4/dist-packages/torch/nn/modules/module.py", line 210, in __call__ |
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
-- E. Culurciello, November 2016 | |
-- test to see if table insert/remove is slower than table addressing | |
iters = 1e5 | |
tablesize = 1e4 | |
tab1={} | |
item = torch.randn(iters,1024) | |
sys.tic() |
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
-- Xception model | |
-- a Torch7 implementation of: https://arxiv.org/abs/1610.02357 | |
-- 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)) |
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
#! /usr/bin/env python3 | |
# E. Culurciello, example of reinforcement learning in Python | |
# | |
# http://mnemstudio.org/path-finding-q-learning-tutorial.htm | |
# 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: |
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
-- Eugenio Culurciello | |
-- August 2016 | |
-- a test to learn to code PredNet-like nets in Torch7 | |
require 'nn' | |
require 'nngraph' | |
torch.setdefaulttensortype('torch.FloatTensor') | |
nngraph.setDebug(true) |
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
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 |
NewerOlder