From a288a8e1e2d3e2e8c81aefc550983e620af838f5 Mon Sep 17 00:00:00 2001 From: Matt J Date: Sat, 5 Nov 2022 07:37:44 -0700 Subject: [PATCH] move files to src dir. add env.yml --- Makefile | 6 +- environment.yml | 111 +++++++++++++++++++++++++++++++++ __init__.py => src/__init__.py | 0 batch.py => src/batch.py | 3 +- data.py => src/data.py | 0 {model => src/model}/cnn.py | 0 {model => src/model}/linear.py | 0 mpv.py => src/mpv.py | 0 pipeline.py => src/pipeline.py | 5 ++ utils.py => src/utils.py | 0 10 files changed, 120 insertions(+), 5 deletions(-) create mode 100644 environment.yml rename __init__.py => src/__init__.py (100%) rename batch.py => src/batch.py (97%) rename data.py => src/data.py (100%) rename {model => src/model}/cnn.py (100%) rename {model => src/model}/linear.py (100%) rename mpv.py => src/mpv.py (100%) rename pipeline.py => src/pipeline.py (95%) rename utils.py => src/utils.py (100%) diff --git a/Makefile b/Makefile index 7e18843..0f26387 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,8 @@ all: - python pipeline.py train + python src/pipeline.py train data: - python data.py + python src/data.py batch: - python batch.py + python src/batch.py diff --git a/environment.yml b/environment.yml new file mode 100644 index 0000000..f155f25 --- /dev/null +++ b/environment.yml @@ -0,0 +1,111 @@ +name: ml +channels: + - pytorch + - conda-forge + - defaults +dependencies: + - _libgcc_mutex=0.1=conda_forge + - _openmp_mutex=4.5=2_gnu + - black=22.6.0=py310h06a4308_0 + - blas=1.0=mkl + - brotli=1.0.9=h5eee18b_7 + - brotli-bin=1.0.9=h5eee18b_7 + - bzip2=1.0.8=h7f98852_4 + - ca-certificates=2022.10.11=h06a4308_0 + - click=8.0.3=pyhd3eb1b0_0 + - colorama=0.4.6=pyhd8ed1ab_0 + - cycler=0.11.0=pyhd3eb1b0_0 + - dbus=1.13.18=hb2f20db_0 + - einops=0.4.1=pyhd8ed1ab_0 + - expat=2.4.9=h6a678d5_0 + - fontconfig=2.13.1=h6c09931_0 + - fonttools=4.25.0=pyhd3eb1b0_0 + - freetype=2.12.1=h4a9f257_0 + - giflib=5.2.1=h7b6447c_0 + - glib=2.69.1=h4ff587b_1 + - gst-plugins-base=1.14.0=h8213a91_2 + - gstreamer=1.14.0=h28cd5cc_2 + - icu=58.2=he6710b0_3 + - intel-openmp=2021.4.0=h06a4308_3561 + - jpeg=9e=h7f8727e_0 + - kiwisolver=1.4.2=py310h295c915_0 + - krb5=1.19.2=hac12032_0 + - lcms2=2.12=h3be6417_0 + - ld_impl_linux-64=2.39=hc81fddc_0 + - lerc=3.0=h295c915_0 + - libbrotlicommon=1.0.9=h5eee18b_7 + - libbrotlidec=1.0.9=h5eee18b_7 + - libbrotlienc=1.0.9=h5eee18b_7 + - libclang=10.0.1=default_hb85057a_2 + - libdeflate=1.8=h7f8727e_5 + - libedit=3.1.20210910=h7f8727e_0 + - libevent=2.1.12=h8f2d780_0 + - libffi=3.3=he6710b0_2 + - libgcc-ng=12.2.0=h65d4601_19 + - libgfortran-ng=12.2.0=h69a702a_19 + - libgfortran5=12.2.0=h337968e_19 + - libgomp=12.2.0=h65d4601_19 + - libllvm10=10.0.1=hbcb73fb_5 + - libnsl=2.0.0=h7f98852_0 + - libopenblas=0.3.21=pthreads_h78a6416_3 + - libpng=1.6.37=hbc83047_0 + - libpq=12.9=h16c4e8d_3 + - libstdcxx-ng=12.2.0=h46fd767_19 + - libtiff=4.4.0=hecacb30_0 + - libuuid=1.0.3=h7f8727e_2 + - libwebp=1.2.4=h11a3e52_0 + - libwebp-base=1.2.4=h5eee18b_0 + - libxcb=1.15=h7f8727e_0 + - libxkbcommon=1.0.1=hfa300c1_0 + - libxml2=2.9.14=h74e7548_0 + - libxslt=1.1.35=h4e12654_0 + - lz4-c=1.9.3=h295c915_1 + - matplotlib=3.5.2=py310h06a4308_0 + - matplotlib-base=3.5.2=py310hf590b9c_0 + - mkl=2021.4.0=h06a4308_640 + - mkl-service=2.4.0=py310h7f8727e_0 + - mkl_fft=1.3.1=py310hd6ae3a3_0 + - mkl_random=1.2.2=py310h00e6091_0 + - munkres=1.1.4=py_0 + - mypy_extensions=0.4.3=py310h06a4308_0 + - ncurses=6.3=h27087fc_1 + - nspr=4.33=h295c915_0 + - nss=3.74=h0370c37_0 + - numpy=1.23.3=py310hd5efca6_0 + - numpy-base=1.23.3=py310h8e6c178_0 + - openssl=1.1.1q=h7f8727e_0 + - packaging=21.3=pyhd3eb1b0_0 + - pathspec=0.10.1=pyhd8ed1ab_0 + - pcre=8.45=h295c915_0 + - pillow=9.2.0=py310hace64e9_1 + - pip=22.3=pyhd8ed1ab_0 + - platformdirs=2.5.2=pyhd8ed1ab_1 + - ply=3.11=py310h06a4308_0 + - pyparsing=3.0.9=py310h06a4308_0 + - pyqt=5.15.7=py310h6a678d5_1 + - python=3.10.6=haa1d7c7_1 + - python-dateutil=2.8.2=pyhd3eb1b0_0 + - pytorch=1.13.0=py3.10_cpu_0 + - pytorch-mutex=1.0=cpu + - qt-main=5.15.2=h327a75a_7 + - qt-webengine=5.15.9=hd2b0992_4 + - qtwebkit=5.212=h4eab89a_4 + - readline=8.1.2=h0f457ee_0 + - setuptools=65.5.0=pyhd8ed1ab_0 + - sip=6.6.2=py310h6a678d5_0 + - six=1.16.0=pyhd3eb1b0_1 + - sqlite=3.39.3=h5082296_0 + - tk=8.6.12=h1ccaba5_0 + - toml=0.10.2=pyhd3eb1b0_0 + - tomli=2.0.1=py310h06a4308_0 + - tornado=6.2=py310h5eee18b_0 + - tqdm=4.64.1=pyhd8ed1ab_0 + - typing_extensions=4.3.0=py310h06a4308_0 + - tzdata=2022e=h191b570_0 + - wheel=0.37.1=pyhd8ed1ab_0 + - xz=5.2.6=h166bdaf_0 + - zlib=1.2.13=h5eee18b_0 + - zstd=1.5.2=ha4553b6_0 + - pip: + - pyqt5-sip==12.11.0 +prefix: /home/personal/Dev/conda/envs/ml diff --git a/__init__.py b/src/__init__.py similarity index 100% rename from __init__.py rename to src/__init__.py diff --git a/batch.py b/src/batch.py similarity index 97% rename from batch.py rename to src/batch.py index 37bf8e9..8a981f9 100644 --- a/batch.py +++ b/src/batch.py @@ -11,8 +11,7 @@ class Batch: def __init__( self, stage: Stage, - model: nn.Module, - device, + model: nn.Module, device, loader: DataLoader, optimizer: optim.Optimizer, criterion: nn.Module, diff --git a/data.py b/src/data.py similarity index 100% rename from data.py rename to src/data.py diff --git a/model/cnn.py b/src/model/cnn.py similarity index 100% rename from model/cnn.py rename to src/model/cnn.py diff --git a/model/linear.py b/src/model/linear.py similarity index 100% rename from model/linear.py rename to src/model/linear.py diff --git a/mpv.py b/src/mpv.py similarity index 100% rename from mpv.py rename to src/mpv.py diff --git a/pipeline.py b/src/pipeline.py similarity index 95% rename from pipeline.py rename to src/pipeline.py index deb5dff..9264895 100644 --- a/pipeline.py +++ b/src/pipeline.py @@ -1,3 +1,8 @@ +""" +main class for building a DL pipeline. + +""" + import click from batch import Batch from model.linear import DNN diff --git a/utils.py b/src/utils.py similarity index 100% rename from utils.py rename to src/utils.py