Skip to content

Instantly share code, notes, and snippets.

View satishgunjal's full-sized avatar
💭
Analytics | CX Architect | Conversational AI | Chatbots | Machine Learning

Satish Gunjal satishgunjal

💭
Analytics | CX Architect | Conversational AI | Chatbots | Machine Learning
View GitHub Profile
@satishgunjal
satishgunjal / gist:39408ecb37df68012c549ffdef65a073
Created October 17, 2020 07:36
There are 10 labels starting from 0 to 9
# There are 10 labels starting from 0 to 9
print(f'Unique train labels: {np.unique(train_labels)}')
print(f'Unique test labels: {np.unique(test_labels)}')
@satishgunjal
satishgunjal / gist:f58643f2bc8b2409d319dc87d189b2e6
Created October 17, 2020 07:35
Shape of training nad test data
# Shape of training nad test data
print(f'Shape of train_images: {train_images.shape}')
print(f'Shape of train_labels: {train_labels.shape}')
print(f'Shape of test_images: {test_images.shape}')
print(f'Shape of test_labels: {test_labels.shape}')
fashion_mnist = tf.keras.datasets.fashion_mnist
(train_images, train_labels), (test_images, test_labels) = fashion_mnist.load_data()
# Creating class label array
class_names = ['T-shirt/top', 'Trouser', 'Pullover', 'Dress', 'Coat', 'Sandal', 'Shirt', 'Sneaker', 'Bag', 'Ankle boot']
@satishgunjal
satishgunjal / gist:eac71ed43c36a1fc5babcfac18155bf7
Created October 17, 2020 07:30
List all files under the input directory
# List all files under the input directory
for dirname, _, filenames in os.walk('/kaggle/input'):
for filename in filenames:
print(os.path.join(dirname, filename))
# List of physical devices
tf.config.experimental.list_physical_devices()
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
import os, datetime
@satishgunjal
satishgunjal / gist:4f02d793d1f7576e995af30b31e9ebc2
Created October 17, 2020 07:25
Versions of Imported Libraries
import pkg_resources
import types
def get_imports():
for name, val in globals().items():
if isinstance(val, types.ModuleType):
name = val.__name__.split(".")[0]
elif isinstance(val, type):
name = val.__module__.split(".")[0]
@satishgunjal
satishgunjal / Delete repository from GitKraken
Created March 7, 2020 13:11
How to delete repository from GitKraken
1. Go to C:\Users\<my_username>\AppData\Roaming and locate the .gitkraken folder
2. Inside this folder you can find a localRepoCache file.
3. Remove the entries that areunwanted/ duplicated, and restart the Gitkraken.
@satishgunjal
satishgunjal / npm pack
Created November 21, 2019 20:18
How to transfer nodejs project supporting packages/libraries if internet not working on host PC
1. Run below command on terminal from where you want to copy the packeges or supprting files
"npm pack"
for more details about this command ref. https://docs.npmjs.com/cli/pack.html
2. Now copy the entire source code folder icluding 'node_modules' on host PC
3. And run below command from host PC terminal 'npm install <name>-<version>.tgz'. Here name is from step 1
4. Now your code should work on host PC.
5. In case any error change the project name in 'package.json' on host PC.
@satishgunjal
satishgunjal / PM2 Startup on Windows (Node.js)
Last active December 4, 2019 11:04
PM2 Startup on Windows (Node.js)
Ref. https://blog.cloudboost.io/nodejs-pm2-startup-on-windows-db0906328d75
In above document Ref Section : [1b]> PM2 save
This section explains how to configure one application and save the configurations.
But if we run 'pm2 save' cmd it will override the previous configurations.
In order to start multiple applications together load all the applications using command 'pm2 reload ecosystem.config.js --env=production'
and then run 'pm2 save' command at the end. It takes a snapshot of currently running Node applications.
We can then restore these applications using 'pm2 resurrect'. Same command will be called during windows reboot.
@satishgunjal
satishgunjal / Readme.txt
Created June 13, 2019 11:03
Setup Github on Visual Studio Code
VS Code ships with a Git source control manager (SCM) extension.
But to use it with GitHub public/private repository please install Git on PC. Make sure to install the latest version of Git.
Go to 'https://github.com/' and create new repository for your project. e.g. gitTest
Now click on 'Clone or Download' and copy the url .e.g. https://github.com/satishgunjal/gitTest.git
Now open the terminal from VS Code and go to the location where you want to create this project directoty.
e.g. terminal path:> C:\Users\satish.gunjal\Google Drive\My Projects\Node.js\Workspace
'gitTest' Project folder will be created under 'Workspace' folder in file system
Now select Terminal Window and type:
git config --global user.name <github userID>
git clone <URL from github link copied earlier> >> this will create the 'gitTest' folder under 'Workspace' folder