Skip to content

Commit

Permalink
🐍 snek net 🐍
Browse files Browse the repository at this point in the history
  • Loading branch information
pjreddie committed Oct 20, 2020
0 parents commit 2800cac
Show file tree
Hide file tree
Showing 78 changed files with 13,337 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
*.o
*.a
*.so
*.dSYM
*.csv
*.out
*.pyc
.fuse*
libuwnet*
mnist*
cifar*
uwnet

# OS Generated #
.DS_Store*
ehthumbs.db
Icon?
Thumbs.db
*.swp
65 changes: 65 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
OPENCV=0
OPENMP=0
DEBUG=0

OBJ=main.o image.o args.o test.o matrix.o list.o data.o classifier.o net.o connected_layer.o activation_layer.o convolutional_layer.o maxpool_layer.o
EXOBJ=test.o

VPATH=./src/:./
EXEC=uwnet
SLIB=lib${EXEC}.so
ALIB=lib${EXEC}.a
OBJDIR=./obj/

CC=gcc
AR=ar
ARFLAGS=rcs
OPTS=-Ofast
LDFLAGS= -lm -pthread
COMMON= -Iinclude/ -Isrc/
CFLAGS=-Wall -Wno-unknown-pragmas -Wfatal-errors -fPIC

ifeq ($(OPENMP), 1)
CFLAGS+= -fopenmp
endif

ifeq ($(DEBUG), 1)
OPTS=-O0 -g
COMMON= -Iinclude/ -Isrc/
endif

CFLAGS+=$(OPTS)

ifeq ($(OPENCV), 1)
COMMON+= -DOPENCV
CFLAGS+= -DOPENCV
LDFLAGS+= `pkg-config --libs opencv`
COMMON+= `pkg-config --cflags opencv`
endif

EXOBJS = $(addprefix $(OBJDIR), $(EXOBJ))
OBJS = $(addprefix $(OBJDIR), $(OBJ))
DEPS = $(wildcard src/*.h) Makefile

all: obj $(SLIB) $(ALIB) $(EXEC)

$(EXEC): $(EXOBJS) $(OBJS)
$(CC) $(COMMON) $(CFLAGS) $^ -o $@ $(LDFLAGS)

$(ALIB): $(OBJS)
$(AR) $(ARFLAGS) $@ $^

$(SLIB): $(OBJS)
$(CC) $(CFLAGS) -shared $^ -o $@ $(LDFLAGS)

$(OBJDIR)%.o: %.c $(DEPS)
$(CC) $(COMMON) $(CFLAGS) -c $< -o $@

obj:
mkdir -p obj

.PHONY: clean

clean:
rm -rf $(OBJS) $(SLIB) $(ALIB) $(EXEC) $(EXOBJS) $(OBJDIR)/*

8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#UW Net#

This is a work in progress.....

but I'm working on it!

[Homework 0](./hw0.md)
[Homework 1](./hw1.md)
21 changes: 21 additions & 0 deletions collate_hw0.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
rm -rf submit/
mkdir -p submit

prepare () {
if [[ $(git diff origin -- $1 | wc -c) -eq 0 ]]; then
echo "WARNING: $1 is unchanged according to git."
fi
cp $1 submit/
}

echo "Creating tarball..."
prepare src/matrix.c
prepare src/activations.c
prepare src/connected_layer.c
prepare tryhw0.py
prepare hw0.ipynb

tar cvzf submit.tar.gz submit
rm -rf submit/
echo "Done. Please upload submit.tar.gz to Canvas."

20 changes: 20 additions & 0 deletions collate_hw1.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
rm -rf submit/
mkdir -p submit

prepare () {
if [[ $(git diff origin -- $1 | wc -c) -eq 0 ]]; then
echo "WARNING: $1 is unchanged according to git."
fi
cp $1 submit/
}

echo "Creating tarball..."
prepare src/convolutional_layer.c
prepare src/maxpool_layer.c
prepare tryhw1.py
prepare hw1.ipynb

tar cvzf submit.tar.gz submit
rm -rf submit/
echo "Done. Please upload submit.tar.gz to Canvas."

Binary file added data/dog.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/test/a.matrix
Binary file not shown.
Binary file added data/test/alog.matrix
Binary file not shown.
Binary file added data/test/alrelu.matrix
Binary file not shown.
Binary file added data/test/arelu.matrix
Binary file not shown.
Binary file added data/test/asoft.matrix
Binary file not shown.
Binary file added data/test/at.matrix
Binary file not shown.
Binary file added data/test/b.matrix
Binary file not shown.
Binary file added data/test/bias.matrix
Binary file not shown.
Binary file added data/test/c.matrix
Binary file not shown.
Binary file added data/test/col2mat.matrix
Binary file not shown.
Binary file added data/test/col2mat2.matrix
Binary file not shown.
Binary file added data/test/db.matrix
Binary file not shown.
Binary file added data/test/dcol.matrix
Binary file not shown.
Binary file added data/test/dcol2.matrix
Binary file not shown.
Binary file added data/test/dog.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/test/dw.matrix
Binary file not shown.
Binary file added data/test/dy.matrix
Binary file not shown.
Binary file added data/test/glog.matrix
Binary file not shown.
Binary file added data/test/glrelu.matrix
Binary file not shown.
Binary file added data/test/grelu.matrix
Binary file not shown.
Binary file added data/test/gsoft.matrix
Binary file not shown.
Binary file added data/test/im2col.matrix
Binary file not shown.
Binary file added data/test/im2col2.matrix
Binary file not shown.
Binary file added data/test/max_dx.matrix
Binary file not shown.
Binary file added data/test/max_dx3.matrix
Binary file not shown.
Binary file added data/test/max_dy.matrix
Binary file not shown.
Binary file added data/test/max_dy3.matrix
Binary file not shown.
Binary file added data/test/max_y.matrix
Binary file not shown.
Binary file added data/test/max_y3.matrix
Binary file not shown.
Binary file added data/test/out.matrix
Binary file not shown.
Binary file added data/test/truth_db.matrix
Binary file not shown.
Binary file added data/test/truth_dw.matrix
Binary file not shown.
Binary file added data/test/truth_dx.matrix
Binary file not shown.
Binary file added data/test/updated_b.matrix
Binary file not shown.
Binary file added data/test/updated_db.matrix
Binary file not shown.
Binary file added data/test/updated_dw.matrix
Binary file not shown.
Binary file added data/test/updated_w.matrix
Binary file not shown.
Binary file added data/test/y.matrix
Binary file not shown.
Binary file added data/test/y1.matrix
Binary file not shown.
Binary file added figs/Matrix_transpose.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added figs/cifar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added figs/im2col.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 2800cac

Please sign in to comment.