Skip to content

Instantly share code, notes, and snippets.

View aymericdelab's full-sized avatar
🎯
Focusing

raschel aymericdelab

🎯
Focusing
View GitHub Profile
@aymericdelab
aymericdelab / download_google_images.ipynb
Last active September 30, 2019 16:57
Download google images using google_images_download
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@aymericdelab
aymericdelab / download_bing_images.ipynb
Last active September 30, 2019 17:09
Download Bing Images using the Image Search API from Azure Cognitive Services
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@aymericdelab
aymericdelab / azure_entry_point_main.py
Created October 5, 2019 16:18
What we need to add to an entry point script so that the model that we run on AWS can also run on Azure
def main():
##ARGPARSE
parser = argparse.ArgumentParser()
parser.add_argument('--data-folder', type=str, dest='data_folder', help='data folder mounting point')
parser.add_argument('--batch-size', type=int, dest='batch_size', default=50, help='mini batch size for training')
parser.add_argument('--learning-rate', type=float, dest='learning_rate', default=0.001, help='learning rate')
parser.add_argument('--prefix', type=str, dest='prefix', help='target path when uploading data to Azure storage')
parser.add_argument('--steps', type=int, dest='steps', help = 'number of steps')
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@aymericdelab
aymericdelab / get_founder_from_deployed_model.ipynb
Created October 8, 2019 10:54
send a request to azure instance where model is deployed
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@aymericdelab
aymericdelab / train_input_fn.py
Last active October 15, 2019 11:06
example of train_input_fn method for Tensorflow Sagemaker Estimator
def train_input_fn(training_dir, hyperparameters):
#training directory is the path to our data in S3 bucket
path=os.path.join(training_dir,'train.json')
with open(path,'rb') as f:
train=json.load(f)
X_train=np.array(train['images'],dtype=np.float64)
y_train=np.array(train['labels'],dtype=np.int64)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@aymericdelab
aymericdelab / deploy_model_Sage.ipynb
Created October 15, 2019 16:14
deploy your model on sagemaker and check if it works
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.