Skip to content

Instantly share code, notes, and snippets.

View Madhivarman's full-sized avatar
🏠
Working from home

Madhivarman Madhivarman

🏠
Working from home
  • Pluto7
  • Bengaluru
View GitHub Profile
import tensorflow as tf
import os
from tensorflow.python.keras.applications import ResNet50
from tensorflow.python.keras.models import Sequential
from tensorflow.python.keras.layers import Dense, Flatten, GlobalAveragePooling2D
from tensorflow.python.keras.applications.resnet50 import preprocess_input
from tensorflow.python.keras.preprocessing.image import ImageDataGenerator
import pandas as pd
import numpy as np
#create a dummy data
user_id = [x for x in range(10000)]
recency = np.random.randint(low=1, high=10, size=10000)
monetary = np.random.randint(low=1, high=10, size=10000)
frequency = np.random.randint(low=1, high=10, size=10000)
@Madhivarman
Madhivarman / multiprocess.py
Created January 26, 2020 18:47
Sample script in Multiprocessing
import time
import datetime
import os
import pandas as pd
from multiprocessing import Process, Queue, current_process
def do_something(fromprocess):
time.sleep(1)
print("Operation Ended for Process:{}, process Id:{}".format(
current_process().name, os.getpid()