Skip to content

Instantly share code, notes, and snippets.

View HamedMP's full-sized avatar
💛

hamed HamedMP

💛
View GitHub Profile
checkpoint_prefix = os.path.join(FLAGS.checkpoint_dir, "saved_checkpoint")
saver.save(sess, checkpoint_prefix, global_step=0, latest_filename=checkpoint_state_name)
def inference(images):
"""Build the CIFAR model up to where it may be used for inference.
Args:
Returns:
logits: Output tensor with the computed logits.
"""
print('Inferencing')
# Reshape input picture
@HamedMP
HamedMP / input_data.py
Created January 3, 2016 19:25
Code we need to input both raw images and labels and also .tfrecords to the network
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
@HamedMP
HamedMP / convert_to_records.py
Last active June 27, 2016 13:10
Code to merge and convert directory of images with their labels into a single .tfrecord file
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@HamedMP
HamedMP / tf_aws.sh
Created November 27, 2015 10:42 — forked from evahlis/tf_aws.sh
# Install build tools
sudo apt-get update
sudo apt-get install -y build-essential git python-pip libfreetype6-dev libxft-dev libncurses-dev libopenblas-dev gfortran python-matplotlib libblas-dev liblapack-dev libatlas-base-dev python-dev python-pydot linux-headers-generic linux-image-extra-virtual unzip python-numpy swig python-pandas python-sklearn unzip
sudo pip install -U pip
# Install CUDA 7
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1410/x86_64/cuda-repo-ubuntu1410_7.0-28_amd64.deb
sudo dpkg -i cuda-repo-ubuntu1410_7.0-28_amd64.deb && rm cuda-repo-ubuntu1410_7.0-28_amd64.deb
sudo apt-get update
sudo apt-get install -y cuda
/* This is a POST request example
* use it for sending request with parameters and getting response frome server
*/
// Sending POST request to server and getting response as a String
String responseFromServer = startUrlConnection("http://www.some_website.domain",
"parameter1="+parameter_variable1+"&parameter2="+parameter_variable2);
try {
HttpClient client = new DefaultHttpClient();
String postURL = "http://somepostaddress.com";
HttpPost post = new HttpPost(postURL);
List<NameValuePair> params = new ArrayList<NameValuePair>();
params.add(new BasicNameValuePair("user", "kris"));
params.add(new BasicNameValuePair("pass", "xyz"));
UrlEncodedFormEntity ent = new UrlEncodedFormEntity(params,HTTP.UTF_8);
post.setEntity(ent);
HttpResponse responsePOST = client.execute(post);