Repository for Implementing SQL-based Softmax Regression for MNIST data paper experiment code [paper] [ppt]
- Ubuntu 18.04.6 LTS
- Anaconda 23.7.2
- PostgreSQL 16.0
- Install using
environment.yml
file
$ conda env create -f environment.yml
- Activate conda environment
$ conda activate sql-4-ml
- If you want to delete conda environment
$ conda env remove -n sql-4-ml
- Create a user and login to postgres account
$ adduser postgres
$ su - postgres
- Download the source code from PostgreSQL website
$ wget https://ftp.postgresql.org/pub/source/v16.0/postgresql-16.0.tar.gz
$ tar -xvzf postgresql-16.0.tar.gz
- Make a directory for build and configure the source tree
$ cd postgresql-16.0
$ mkdir build
$ ./configure --prefix=/home/postgres/postgrsql-16.0/build
- Build and install the source code (make -j = Make build faster using multiple processes)
$ make -j install
- Add the shared library path to
~/.bashrc
$ vim ~/.bashrc
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/postgres/postgresql-16.0/build/lib
export PATH=/home/postgres/postgresql-16.0/build/bin:$PATH
$ source ~/.bashrc
- Add the shared library to
.profile
of postgres user
$ cd ~
$ vim .profile
PATH=$PATH:/home/postgres/postgresql-9.4.5/build/bin
export PATH
$ . ~/.profile
- Initialize the database storage with
initdb
command of postgres
$ initdb -D /home/postgres/test_data
$ pg_ctl -D /home/postgres/test_data -l logfile start
- Stop the PostgreSQL server
$ pg_ctl -D /home/postgres/test_data -m smart stop
$ conda activate sql-4-ml
$ python3 experiment.py