Saleh Sargolzaei

Bachelor's in Computer Engineering

About me

I'm Saleh,

a Machine Learning enthusiast

I am passionate about how humans learn and love exploring how to build intelligent systems that can learn as humans do. I am especially interested in integrating machine learning and other disciplines such as healthcare, environmental science, etc. You can find my projects and publications on my CV.

Deep Learning

+3
Generator Network
DCGAN for Face Generation

In this project, I defined and trained a DCGAN on a dataset of faces. The goal is to get a generator network to generate new images of faces that look as realistic as possible! #### Get the Data I have used the [CelebFaces Attributes Dataset (CelebA)](http://mmlab.ie.cuhk.edu.hk/projects/CelebA.html) to train the adversarial networks. #### Pre-processed Data Each of the CelebA images has been cropped to remove parts of the image that don't include a face, then resized down to 64x64x3 NumPy images. Some sample data is show below. <img src='https://github.com/salehsargolzaee/DCGAN-for-face-generation/blob/main/assets/processed_face_data.png?raw=true' width=60% /> > You can download this data [by clicking here](https://s3.amazonaws.com/video.udacity-data.com/topher/2018/November/5be7eb6f_processed-celeba-small/processed-celeba-small.zip) This is a zip file that you'll need to extract in the home directory of this notebook for further loading and processing. After extracting the data, you should be left with a directory of data `processed_celeba_small/` ### Network Architecture The architecture used for the generator and the discriminator was inspired by the [original DCGAN paper](https://arxiv.org/pdf/1511.06434.pdf): <img src="https://github.com/salehsargolzaee/DCGAN-for-face-generation/blob/main/assets/Generator.png?raw=true" alt="Network-architecture" width="620"/> **I have also used the same hyperparameters mentioned in this paper.** The loss functions were inspired by the LSGAN paper. > Binary cross-entropy loss function may lead to the vanishing gradients problem during the learning process. To overcome such a problem, I've used a least-squares loss function for the discriminator. This structure is also referred to as a least-squares GAN or LSGAN, and you can [read the original paper on LSGANs, here](https://arxiv.org/pdf/1611.04076.pdf). The authors show that LSGANs are able to generate higher quality images than regular GANs and that this loss type is a bit more stable during training! Finally, the last layer of the discriminator was inspired by patchGAN. PatchGAN has fewer parameters, runs faster, and classifies images as fake or real. You can check about patchGAN in this paper: [Image-to-Image Translation with Conditional Adversarial Networks](https://arxiv.org/pdf/1611.07004.pdf). ### Results You can see the value for losses below: <img src="https://github.com/salehsargolzaee/DCGAN-for-face-generation/blob/main/assets/losses.png?raw=true" alt="losses" width="620"/> Some of the generated faces after `25 epochs` have been shown below. As you can see, they're not the most realistic faces in the world, but I argue that they are fantastic, considering that : 1. I didn't put so much time experimenting with hyperparameters, 2. The model is not very deep, 3. The number of epochs is relatively low, 4. And the initial input is small. <img src="https://github.com/salehsargolzaee/DCGAN-for-face-generation/blob/main/assets/generated_faces.png?raw=true" alt="generated faces" width="620"/>

LSTM Architecture
LSTM for Sentiment Analysis

In this notebook, I implemented a recurrent neural network (Long short-term memory) using PyTorch that performs sentiment analysis. Here I used a dataset of Amazon baby products reviews, accompanied by product names and rates. You can find it [here](https://www.kaggle.com/ronnie3rg/amazon-baby-sentiment-analysis) #### Network Architecture The architecture for this network is shown below. <img src="https://github.com/salehsargolzaee/LSTM-for-Sentiment-Analysis/blob/main/assets/network_raedme.png?raw=true" alt="Network-architecture" width="620"/> The layers are as follows: 1. An embedding layer that converts our word tokens (integers) into embeddings of a specific size. 2. An LSTM layer defined by a hidden_state size and number of layers 3. A fully-connected output layer that maps the LSTM layer outputs to a desired output_size 4. A sigmoid activation layer which turns all outputs into a value 0-1; return only the last sigmoid output as the output of this network. ___ **It is not possible to push the model's `state_dict` here due to its size. If you need it, feel free to [contact](mailto:salehsargolzaee@gmail.com) me.** #### Dataset It's a `CSV` file consisting of reviews of Amazon baby products. You can download it from [`Kaggle`](https://www.kaggle.com/datasets/ronnie3rg/amazon-baby-sentiment-analysis?select=amazon_baby.csv). It consists of product names, reviews, and ratings associated with each. Bellow, you can see dataframe info: |Data columns (total 3 columns):||| | ----- | ----- | ----- | |name |183213 non-null |object| |review |182702 non-null |object| |rating |183531 non-null |int64| Head of the data: |name| review| rating| |---|---|---| |Planetwise Flannel| Wipes These flannel wipes are OK, but in my opinion ...| 3 |Planetwise Wipe Pouch| it came early and was not disappointed. i love...| 5 |Annas Dream Full Quilt with 2 Shams| Very soft and comfortable and warmer than it l...| 5 |Stop Pacifier Sucking without tears with Thumb...| This is a product well worth the purchase. I ...| 5 |Stop Pacifier Sucking without tears with Thumb...| All of my kids have cried non-stop when I trie...| 5

Tutorials

Audio signal
Audio Signal Processing and Feature Extraction

In this repository, I have briefly explained (in Persian) how to extract features from the audio signal using the librosa library in python.

Photo of Vectors
Linear Algebra Review for Machine Learning

A review of Linear Algebra in Persian (Based on the Machine Learning course, CS229, offered by Stanford) <details> <summary>If you don't speak Persian, click to find out more about this repository.</summary> <p> One of the best Machine Learning courses I have watched is <a href="http://cs229.stanford.edu/syllabus-summer2019.html">"CS229: Machine Learning - The Summer Edition"</a> by Stanford. Unlike other courses that offer quick, superficial definitions, this course thoroughly reviews the essential concepts in Probability, Statistics, and Linear Algebra. Recently, I was studying the Linear Algebra section of the course and taking notes. I realized that many of the topics covered in the course were asked during a Ph.D. interview I had a few months ago. Since few good Persian resources are available, I decided to share my notes here in hopes of helping others succeed in the Linear Algebra part of their interviews.</p> </details> <br/> <div dir = "rtl" align="center"> <h3 align="center">مروری بر مباحث جبرخطی</h3> <p align="center"> مورد نیاز برای یادگیری ماشین <br /> </p> </div> <br> <div dir="rtl"> یکی از دوره‌های مورد علاقه‌ی من در <a href= "http://cs229.stanford.edu/syllabus-summer2019.html">حوزه‌ی یادگیری ماشین، دوره CS229 ترم تابستان دانشگاه استنفورد است.</a> در‌حالی که دوره‌های آنلاین زیادی در تلاشند که این حوزه‌ را به صورت فست‌فودی ارائه کنند، این دوره به طور جامع مطالب مربوط به آمار و احتمال و جبرخطی مربوطه را توضیح می‌دهد. به تازگی مروری بر جبرخطی که در ابتدای این دوره ارائه می‌شود، داشتم و مطالبش را به فارسی یادداشت کرده‌ام. تعداد زیادی از مطالب مرور شده، در مصاحبه‌ای که مدتی پیش برای یک موقعیت دکترای مستقیم داشتم از من پرسیده شده بود. با توجه به کمبود منابع فارسی، فکر کردم که شاید یادداشت‌های من به درد دوست دیگری بخورد و تصمیم گرفتم یادداشت‌های خودم را اینجا به اشتراک بگذارم. </div> <br/> <img src = "https://raw.githubusercontent.com/salehsargolzaee/Linear-Algebra-Review-For-Machine-Learning/45e3520cd39f639d556d5d90f5b75f925aea988d/vertopal_c4f0ffde513149a9b80459c18a383245/media/image1.png"/> <img src = "https://raw.githubusercontent.com/salehsargolzaee/Linear-Algebra-Review-For-Machine-Learning/45e3520cd39f639d556d5d90f5b75f925aea988d/vertopal_c4f0ffde513149a9b80459c18a383245/media/image3.png"/> <img src = "https://raw.githubusercontent.com/salehsargolzaee/Linear-Algebra-Review-For-Machine-Learning/45e3520cd39f639d556d5d90f5b75f925aea988d/vertopal_c4f0ffde513149a9b80459c18a383245/media/image4.png"/> <img src = "https://raw.githubusercontent.com/salehsargolzaee/Linear-Algebra-Review-For-Machine-Learning/45e3520cd39f639d556d5d90f5b75f925aea988d/vertopal_c4f0ffde513149a9b80459c18a383245/media/image5.png"/> <img src = "https://raw.githubusercontent.com/salehsargolzaee/Linear-Algebra-Review-For-Machine-Learning/45e3520cd39f639d556d5d90f5b75f925aea988d/vertopal_c4f0ffde513149a9b80459c18a383245/media/image6.png"/> <img src = "https://raw.githubusercontent.com/salehsargolzaee/Linear-Algebra-Review-For-Machine-Learning/45e3520cd39f639d556d5d90f5b75f925aea988d/vertopal_c4f0ffde513149a9b80459c18a383245/media/image7.png"/> <img src = "https://raw.githubusercontent.com/salehsargolzaee/Linear-Algebra-Review-For-Machine-Learning/45e3520cd39f639d556d5d90f5b75f925aea988d/vertopal_c4f0ffde513149a9b80459c18a383245/media/image8.png"/> <img src = "https://raw.githubusercontent.com/salehsargolzaee/Linear-Algebra-Review-For-Machine-Learning/45e3520cd39f639d556d5d90f5b75f925aea988d/vertopal_c4f0ffde513149a9b80459c18a383245/media/image9.png"/> <img src = "https://raw.githubusercontent.com/salehsargolzaee/Linear-Algebra-Review-For-Machine-Learning/45e3520cd39f639d556d5d90f5b75f925aea988d/vertopal_c4f0ffde513149a9b80459c18a383245/media/image10.png"/> <img src = "https://raw.githubusercontent.com/salehsargolzaee/Linear-Algebra-Review-For-Machine-Learning/45e3520cd39f639d556d5d90f5b75f925aea988d/vertopal_c4f0ffde513149a9b80459c18a383245/media/image11.png"/> <img src = "https://raw.githubusercontent.com/salehsargolzaee/Linear-Algebra-Review-For-Machine-Learning/45e3520cd39f639d556d5d90f5b75f925aea988d/vertopal_c4f0ffde513149a9b80459c18a383245/media/image12.png"/> <img src = "https://raw.githubusercontent.com/salehsargolzaee/Linear-Algebra-Review-For-Machine-Learning/45e3520cd39f639d556d5d90f5b75f925aea988d/vertopal_c4f0ffde513149a9b80459c18a383245/media/image13.png"/> <img src = "https://raw.githubusercontent.com/salehsargolzaee/Linear-Algebra-Review-For-Machine-Learning/45e3520cd39f639d556d5d90f5b75f925aea988d/vertopal_c4f0ffde513149a9b80459c18a383245/media/image14.png"/> <img src = "https://raw.githubusercontent.com/salehsargolzaee/Linear-Algebra-Review-For-Machine-Learning/45e3520cd39f639d556d5d90f5b75f925aea988d/vertopal_c4f0ffde513149a9b80459c18a383245/media/image15.png"/> <img src = "https://raw.githubusercontent.com/salehsargolzaee/Linear-Algebra-Review-For-Machine-Learning/45e3520cd39f639d556d5d90f5b75f925aea988d/vertopal_c4f0ffde513149a9b80459c18a383245/media/image16.png"/> <img src = "https://raw.githubusercontent.com/salehsargolzaee/Linear-Algebra-Review-For-Machine-Learning/45e3520cd39f639d556d5d90f5b75f925aea988d/vertopal_c4f0ffde513149a9b80459c18a383245/media/image17.png"/> <img src = "https://raw.githubusercontent.com/salehsargolzaee/Linear-Algebra-Review-For-Machine-Learning/45e3520cd39f639d556d5d90f5b75f925aea988d/vertopal_c4f0ffde513149a9b80459c18a383245/media/image18.png"/> <img src = "https://raw.githubusercontent.com/salehsargolzaee/Linear-Algebra-Review-For-Machine-Learning/45e3520cd39f639d556d5d90f5b75f925aea988d/vertopal_c4f0ffde513149a9b80459c18a383245/media/image19.png"/> <img src = "https://raw.githubusercontent.com/salehsargolzaee/Linear-Algebra-Review-For-Machine-Learning/45e3520cd39f639d556d5d90f5b75f925aea988d/vertopal_c4f0ffde513149a9b80459c18a383245/media/image20.png"/> <img src = "https://raw.githubusercontent.com/salehsargolzaee/Linear-Algebra-Review-For-Machine-Learning/45e3520cd39f639d556d5d90f5b75f925aea988d/vertopal_c4f0ffde513149a9b80459c18a383245/media/image21.png"/> <img src = "https://raw.githubusercontent.com/salehsargolzaee/Linear-Algebra-Review-For-Machine-Learning/45e3520cd39f639d556d5d90f5b75f925aea988d/vertopal_c4f0ffde513149a9b80459c18a383245/media/image22.png"/> <img src = "https://raw.githubusercontent.com/salehsargolzaee/Linear-Algebra-Review-For-Machine-Learning/45e3520cd39f639d556d5d90f5b75f925aea988d/vertopal_c4f0ffde513149a9b80459c18a383245/media/image23.png"/> <img src = "https://raw.githubusercontent.com/salehsargolzaee/Linear-Algebra-Review-For-Machine-Learning/45e3520cd39f639d556d5d90f5b75f925aea988d/vertopal_c4f0ffde513149a9b80459c18a383245/media/image24.png"/> <img src = "https://raw.githubusercontent.com/salehsargolzaee/Linear-Algebra-Review-For-Machine-Learning/45e3520cd39f639d556d5d90f5b75f925aea988d/vertopal_c4f0ffde513149a9b80459c18a383245/media/image25.png"/> <img src = "https://raw.githubusercontent.com/salehsargolzaee/Linear-Algebra-Review-For-Machine-Learning/45e3520cd39f639d556d5d90f5b75f925aea988d/vertopal_c4f0ffde513149a9b80459c18a383245/media/image26.png"/> <img src = "https://raw.githubusercontent.com/salehsargolzaee/Linear-Algebra-Review-For-Machine-Learning/45e3520cd39f639d556d5d90f5b75f925aea988d/vertopal_c4f0ffde513149a9b80459c18a383245/media/image27.png"/> <img src = "https://raw.githubusercontent.com/salehsargolzaee/Linear-Algebra-Review-For-Machine-Learning/45e3520cd39f639d556d5d90f5b75f925aea988d/vertopal_c4f0ffde513149a9b80459c18a383245/media/image28.png"/> <img src = "https://raw.githubusercontent.com/salehsargolzaee/Linear-Algebra-Review-For-Machine-Learning/45e3520cd39f639d556d5d90f5b75f925aea988d/vertopal_c4f0ffde513149a9b80459c18a383245/media/image29.png"/> <img src = "https://raw.githubusercontent.com/salehsargolzaee/Linear-Algebra-Review-For-Machine-Learning/45e3520cd39f639d556d5d90f5b75f925aea988d/vertopal_c4f0ffde513149a9b80459c18a383245/media/image30.png"/> <img src = "https://raw.githubusercontent.com/salehsargolzaee/Linear-Algebra-Review-For-Machine-Learning/45e3520cd39f639d556d5d90f5b75f925aea988d/vertopal_c4f0ffde513149a9b80459c18a383245/media/image31.png"/> <img src = "https://raw.githubusercontent.com/salehsargolzaee/Linear-Algebra-Review-For-Machine-Learning/45e3520cd39f639d556d5d90f5b75f925aea988d/vertopal_c4f0ffde513149a9b80459c18a383245/media/image32.png"/> <img src = "https://raw.githubusercontent.com/salehsargolzaee/Linear-Algebra-Review-For-Machine-Learning/45e3520cd39f639d556d5d90f5b75f925aea988d/vertopal_c4f0ffde513149a9b80459c18a383245/media/image33.png"/> <img src = "https://raw.githubusercontent.com/salehsargolzaee/Linear-Algebra-Review-For-Machine-Learning/45e3520cd39f639d556d5d90f5b75f925aea988d/vertopal_c4f0ffde513149a9b80459c18a383245/media/image34.png"/> <img src = "https://raw.githubusercontent.com/salehsargolzaee/Linear-Algebra-Review-For-Machine-Learning/45e3520cd39f639d556d5d90f5b75f925aea988d/vertopal_c4f0ffde513149a9b80459c18a383245/media/image35.png"/> <img src = "https://raw.githubusercontent.com/salehsargolzaee/Linear-Algebra-Review-For-Machine-Learning/45e3520cd39f639d556d5d90f5b75f925aea988d/vertopal_c4f0ffde513149a9b80459c18a383245/media/image36.png"/> <img src = "https://raw.githubusercontent.com/salehsargolzaee/Linear-Algebra-Review-For-Machine-Learning/45e3520cd39f639d556d5d90f5b75f925aea988d/vertopal_c4f0ffde513149a9b80459c18a383245/media/image37.png"/> <img src = "https://raw.githubusercontent.com/salehsargolzaee/Linear-Algebra-Review-For-Machine-Learning/45e3520cd39f639d556d5d90f5b75f925aea988d/vertopal_c4f0ffde513149a9b80459c18a383245/media/image38.png"/> <img src = "https://raw.githubusercontent.com/salehsargolzaee/Linear-Algebra-Review-For-Machine-Learning/45e3520cd39f639d556d5d90f5b75f925aea988d/vertopal_c4f0ffde513149a9b80459c18a383245/media/image39.png"/> <img src = "https://raw.githubusercontent.com/salehsargolzaee/Linear-Algebra-Review-For-Machine-Learning/45e3520cd39f639d556d5d90f5b75f925aea988d/vertopal_c4f0ffde513149a9b80459c18a383245/media/image40.png"/> <img src = "https://raw.githubusercontent.com/salehsargolzaee/Linear-Algebra-Review-For-Machine-Learning/45e3520cd39f639d556d5d90f5b75f925aea988d/vertopal_c4f0ffde513149a9b80459c18a383245/media/image41.png"/> <img src = "https://raw.githubusercontent.com/salehsargolzaee/Linear-Algebra-Review-For-Machine-Learning/45e3520cd39f639d556d5d90f5b75f925aea988d/vertopal_c4f0ffde513149a9b80459c18a383245/media/image42.png"/> <img src = "https://raw.githubusercontent.com/salehsargolzaee/Linear-Algebra-Review-For-Machine-Learning/45e3520cd39f639d556d5d90f5b75f925aea988d/vertopal_c4f0ffde513149a9b80459c18a383245/media/image43.png"/> <img src = "https://raw.githubusercontent.com/salehsargolzaee/Linear-Algebra-Review-For-Machine-Learning/45e3520cd39f639d556d5d90f5b75f925aea988d/vertopal_c4f0ffde513149a9b80459c18a383245/media/image44.png"/> <img src = "https://raw.githubusercontent.com/salehsargolzaee/Linear-Algebra-Review-For-Machine-Learning/45e3520cd39f639d556d5d90f5b75f925aea988d/vertopal_c4f0ffde513149a9b80459c18a383245/media/image45.png"/> <img src = "https://raw.githubusercontent.com/salehsargolzaee/Linear-Algebra-Review-For-Machine-Learning/45e3520cd39f639d556d5d90f5b75f925aea988d/vertopal_c4f0ffde513149a9b80459c18a383245/media/image46.png"/> <img src = "https://raw.githubusercontent.com/salehsargolzaee/Linear-Algebra-Review-For-Machine-Learning/45e3520cd39f639d556d5d90f5b75f925aea988d/vertopal_c4f0ffde513149a9b80459c18a383245/media/image47.png"/> <img src = "https://raw.githubusercontent.com/salehsargolzaee/Linear-Algebra-Review-For-Machine-Learning/45e3520cd39f639d556d5d90f5b75f925aea988d/vertopal_c4f0ffde513149a9b80459c18a383245/media/image48.png"/> <img src = "https://raw.githubusercontent.com/salehsargolzaee/Linear-Algebra-Review-For-Machine-Learning/45e3520cd39f639d556d5d90f5b75f925aea988d/vertopal_c4f0ffde513149a9b80459c18a383245/media/image49.png"/> <img src = "https://raw.githubusercontent.com/salehsargolzaee/Linear-Algebra-Review-For-Machine-Learning/45e3520cd39f639d556d5d90f5b75f925aea988d/vertopal_c4f0ffde513149a9b80459c18a383245/media/image50.png"/> <img src = "https://raw.githubusercontent.com/salehsargolzaee/Linear-Algebra-Review-For-Machine-Learning/45e3520cd39f639d556d5d90f5b75f925aea988d/vertopal_c4f0ffde513149a9b80459c18a383245/media/image51.png"/> <img src = "https://raw.githubusercontent.com/salehsargolzaee/Linear-Algebra-Review-For-Machine-Learning/45e3520cd39f639d556d5d90f5b75f925aea988d/vertopal_c4f0ffde513149a9b80459c18a383245/media/image52.png"/> <img src = "https://raw.githubusercontent.com/salehsargolzaee/Linear-Algebra-Review-For-Machine-Learning/45e3520cd39f639d556d5d90f5b75f925aea988d/vertopal_c4f0ffde513149a9b80459c18a383245/media/image53.png"/> <img src = "https://raw.githubusercontent.com/salehsargolzaee/Linear-Algebra-Review-For-Machine-Learning/45e3520cd39f639d556d5d90f5b75f925aea988d/vertopal_c4f0ffde513149a9b80459c18a383245/media/image54.png"/>

Contact Me

I'll be glad to hear your thoughts on Machine Learning!

Email address: salehsargolzaee@gmail.com

LinkedIn: www.linkedin.com/in/saleh-sargolzaee