Skip to content

Instantly share code, notes, and snippets.

View suyashdamle's full-sized avatar
🎯
Focusing

Suyash Damle suyashdamle

🎯
Focusing
View GitHub Profile
'''
- For generator: (creates set of fake images in NCHW format ;
2nd channel being label encodings)
- Generate random integers between 0 and 9 (of 1 X batch_size shape).
These would be our labels for fake images
- Convert these into one-hot encoding : --> (batch_size, 10 )
- Broadcast to (batch_size X 10 X 10 shape) --> (batch_size, 10, 10)
- Add another dimension for channel: --> (batch_size, 1, 10, 10)
- Generate a 10X10 noise matrix using mx.random.normal() --> (batch_size, 1, 10, 10)
- Concatenate the label encodings with noise: --> (batch_size, 2, 10, 10)
@suyashdamle
suyashdamle / openai_gym_video.ipynb
Last active May 19, 2019 14:39
OpenAI_gym_video.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@suyashdamle
suyashdamle / client.py
Created April 22, 2019 15:40
Joint UDP-TCP client-server programs in Python using Socket Programming
import socket
HOST = 'localhost' # The server's hostname or IP address
PORT = 64532 # The port used by the server
use_tcp = False
if not use_tcp:
################# UDP CLIENT ####################
@suyashdamle
suyashdamle / Finding data packet boundaries using struct.ipynb
Created April 7, 2019 13:08
Finding message boundaries over the TCP sockets by appending length of message
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@suyashdamle
suyashdamle / trim.py
Created February 17, 2019 07:31
Trim images in bulk using opencv to pre-defined dimensions (implemented for grayscale images)
import os
import numpy as np
import cv2
from scipy.misc import imsave
DIR = './'
LEFT=190
RIGHT=1246
TOP=0
BOTTOM=590