The goals / steps of this project are the following:
import tensorflow as tf
import tensorflow.contrib.slim as slim
from tensorflow.contrib.layers import flatten
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
from PIL import Image
from sklearn.utils import shuffle
from sklearn.metrics import confusion_matrix
import numpy as np
import cv2
import math
import os
import time
import pickle
%matplotlib inline
# Constants
IMG_SIZE = 32 # square image of size IMG_SIZE x IMG_SIZE
GRAYSCALE = False # convert image to grayscale?
NUM_CHANNELS = 1 if GRAYSCALE else 3
NUM_CLASSES = 43
# Model parameters
learningrate = 5e-3 # learning rate
KEEP_PROB = 0.5 # dropout keep probability
# Training process
RESTORE = False # restore previous model, don't train?
RESUME = False # resume training from previously trained model?
NUM_EPOCH = 100
BATCH_SIZE = 128 # batch size for training (relatively small)
BATCH_SIZE_INF = 2048 # batch size for running inference, e.g. calculating accuracy
SAVE_MODEL = True # save trained model to disk?
MODEL_SAVE_PATH = 'model.ckpt' # where to save trained model
Load the Traffic Sign data
training_file = 'train.p'
validation_file = 'valid.p'
testing_file = 'test.p'
with open(training_file, mode='rb') as f:
train = pickle.load(f)
with open(validation_file, mode='rb') as f:
valid = pickle.load(f)
with open(testing_file, mode='rb') as f:
test = pickle.load(f)
X_train, y_train = train['features'], train['labels']
X_valid, y_valid = valid['features'], valid['labels']
X_test, y_test = test['features'], test['labels']
### To start off let's do a basic data summary.
# Number of training examples
n_train = X_train.shape[0]
# Number of validation examples
n_validation = X_valid.shape[0]
# Number of testing examples
n_test = X_test.shape[0]
# What's the shape of an image?
image_shape = X_train[0].shape
# How many classes are in the dataset
n_classes = np.unique(y_train).shape[0]
print("Number of training examples =", n_train)
print("Number of validation examples =", n_validation)
print("Number of testing examples =", n_test)
print("Image data shape =", image_shape)
print("Number of classes =", n_classes)
sign_names = pd.DataFrame(pd.read_csv('signnames.csv'))
sign_names.head(20)
sign_names.tail(20)
Display 10 random traffic signs
num_images = 10
indices = np.random.choice(list(range(n_train)), size=num_images, replace=False)
# Obtain the images and labels
images = X_train[indices]
labels = y_train[indices]
# Display the images
plt.rcParams["figure.figsize"] = [15, 5]
for i, image in enumerate(images):
plt.subplot(1, num_images, i+1)
plt.imshow(image)
plt.title('Label: %d' % labels[i])
plt.tight_layout()
plt.show()
# Count frequency of each label
labels, counts = np.unique(y_train, return_counts=True)
# Plot the histogram
plt.rcParams["figure.figsize"] = [15, 5]
axes = plt.gca()
axes.set_xlim([-1,43])
plt.bar(labels, counts, tick_label=labels, width=0.8, align='center')
plt.title('Class Distribution across Training Data')
plt.show()
The training data's class distribution is highly skewed.
# Count frequency of each label
labels, counts = np.unique(y_valid, return_counts=True)
# Plot the histogram
plt.rcParams["figure.figsize"] = [15, 5]
axes = plt.gca()
axes.set_xlim([-1,43])
plt.bar(labels, counts, tick_label=labels, width=0.8, align='center')
plt.title('Class Distribution across Validation Data')
plt.show()
The validation data is also skewed, in the same way the training data is skewed. The only difference is the individual counts for each class are less.
# Count frequency of each label
labels, counts = np.unique(y_test, return_counts=True)
# Plot the histogram
plt.rcParams["figure.figsize"] = [15, 5]
axes = plt.gca()
axes.set_xlim([-1,43])
plt.bar(labels, counts, tick_label=labels, width=0.8, align='center')
plt.title('Class Distribution across Testing Data')
plt.show()
The test data is also skewed, in the same way the training data is skewed. The only difference is the individual counts for each class are less.
I performed the following data preprocessing steps:
Initial test of the model performance with current dataset without twicking any parameters
Standardize the pixel values: new_value = (old_value - 128) / 128
Convert the integer class labels into one-hot encoded labels
Randomly shuffle the data
def preprocess_data_shuffle(X, y):
"""
Preprocess image data, and convert labels into one-hot
and shuffle the data
Arguments:
* X: Image data
* y: Labels
Returns:
* Preprocessed X_shuffled, one-hot version of y_shuffled
"""
# Convert from RGB to grayscale if applicable
if GRAYSCALE:
X = rgb_to_gray(X)
# Make all image array values fall within the range -1 to 1
# Note all values in original images are between 0 and 255, as uint8
X = X.astype('float32')
X = (X - 128.) / 128.
# Convert the labels from numerical labels to one-hot encoded labels
y_onehot = np.zeros((y.shape[0], NUM_CLASSES))
for i, onehot_label in enumerate(y_onehot):
onehot_label[y[i]] = 1.
y = y_onehot
#Shuffle the data
X_shuffled, y_shuffled = shuffle(X, y)
return X_shuffled, y_shuffled
def preprocess_data(X, y):
"""
Preprocess image data, and convert labels into one-hot
Arguments:
* X: Image data
* y: Labels
Returns:
* Preprocessed X, one-hot version of y
"""
# Convert from RGB to grayscale if applicable
if GRAYSCALE:
X = rgb_to_gray(X)
# Make all image array values fall within the range -1 to 1
# Note all values in original images are between 0 and 255, as uint8
X = X.astype('float32')
X = (X - 128.) / 128.
# Convert the labels from numerical labels to one-hot encoded labels
y_onehot = np.zeros((y.shape[0], NUM_CLASSES))
for i, onehot_label in enumerate(y_onehot):
onehot_label[y[i]] = 1.
y = y_onehot
return X, y
def next_batch(X, y, batch_size, augment_data):
"""
Generator to generate data and labels
Each batch yielded is unique, until all data is exhausted
If all data is exhausted, the next call to this generator will throw a StopIteration
Arguments:
* X: image data, a tensor of shape (dataset_size, 32, 32, 3)
* y: labels, a tensor of shape (dataset_size,) <-- i.e. a list
* batch_size: Size of the batch to yield
* augment_data: Boolean value, whether to augment the data (i.e. perform image transform)
Yields:
A tuple of (images, labels), where:
* images is a tensor of shape (batch_size, 32, 32, 3)
* labels is a tensor of shape (batch_size,)
"""
# We know X and y are randomized from the train/validation split already,
# so just sequentially yield the batches
start_idx = 0
while start_idx < X.shape[0]:
images = X[start_idx : start_idx + batch_size]
labels = y[start_idx : start_idx + batch_size]
yield (np.array(images), np.array(labels))
start_idx += batch_size
def calculate_accuracy(data_gen, data_size, batch_size, accuracy, x, y, keep_prob, sess):
"""
Helper function to calculate accuracy on a particular dataset
Arguments:
* data_gen: Generator to generate batches of data
* data_size: Total size of the data set, must be consistent with generator
* batch_size: Batch size, must be consistent with generator
* accuracy, x, y, keep_prob: Tensor objects in the neural network
* sess: TensorFlow session object containing the neural network graph
Returns:
* Float representing accuracy on the data set
"""
num_batches = math.ceil(data_size / batch_size)
last_batch_size = data_size % batch_size
accs = [] # accuracy for each batch
for _ in range(num_batches):
images, labels = next(data_gen)
# Perform forward pass and calculate accuracy
# Note we set keep_prob to 1.0, since we are performing inference
acc = sess.run(accuracy, feed_dict={x: images, y: labels, keep_prob: 1.})
accs.append(acc)
# Calculate average accuracy of all full batches (the last batch is the only partial batch)
acc_full = np.mean(accs[:-1])
# Calculate weighted average of accuracy accross batches
acc = (acc_full * (data_size - last_batch_size) + accs[-1] * last_batch_size) / data_size
return acc
random_transform()
to randomly apply multiple transformation on one image.Since the traffic sign samples is not distrubted equally, this could affect the CNN's performance. The network would be biased toward classes with more samples. Data Augmentation generates additional data on each traffic sign. For example, if the average sample for each classes is 1000 images. Any class has less than 300 images need to generate more data.
Data Augmentation includes but not limited to blurring, rotating, shearing, translating, changing brighness on original images. For image transformation, I found this documentation from OpenCV is helpful:
def translate(img):
"Shift orginal image around within image size"
x = img.shape[0]
y = img.shape[1]
x_shift = np.random.uniform(-0.3 * x, 0.3 * x)
y_shift = np.random.uniform(-0.3 * y, 0.3 * y)
shift_matrix = np.float32([[1, 0, x_shift], [0, 1, y_shift]])
shift_img = cv2.warpAffine(img, shift_matrix, (x, y))
return shift_img
def rotate(img):
" Rotate original image at random rotation angle from -90 degree to +90 degree"
row, col, channel = img.shape
angle = np.random.uniform(-90, 90)
rotation_point = (row / 2, col / 2)
rotation_matrix = cv2.getRotationMatrix2D(rotation_point, angle, 1)
rotated_img = cv2.warpAffine(img, rotation_matrix, (col, row))
return rotated_img
def shear(img):
" Affirm Transformation orignal image"
x, y, channel = img.shape
shear = np.random.randint(5,15)
pts1 = np.array([[5, 5], [20, 5], [5, 20]]).astype('float32')
pt1 = 5 + shear * np.random.uniform() - shear / 2
pt2 = 20 + shear * np.random.uniform() - shear / 2
pts2 = np.float32([[pt1, 5], [pt2, pt1], [5, pt2]])
M = cv2.getAffineTransform(pts1, pts2)
result = cv2.warpAffine(img, M, (y, x))
return result
def blur(img):
r_int = np.random.randint(0, 2)
odd_size = 2 * r_int + 1
return cv2.GaussianBlur(img, (odd_size, odd_size), 0)
def gamma(img):
gamma = np.random.uniform(0.2, 1.5)
invGamma = 1.0 / gamma
table = np.array([((i / 255.0) ** invGamma) * 255 for i in np.arange(0, 256)]).astype("uint8")
new_img = cv2.LUT(img, table)
return new_img
def random_transform(img):
# There are total of 6 transformation
# I will create an boolean array of 6 elements [ 0 or 1]
a = np.random.randint(0, 2, [1, 5]).astype('bool')[0]
if a[0] == 1: img = translate(img)
if a[1] == 1: img = rotate(img)
if a[2] == 1: img = shear(img)
if a[3] == 1: img = blur(img)
if a[4] == 1: img = gamma(img)
return img
I generate 5 images per transformation on a random image of training set.
i = 22700
sample_1 = X_train[i]
translated_img = []
rotated_img = []
shear_img = []
blur_img = []
noise_img = []
gamma_img=[]
for i in range(5):
translated_img.append(translate(sample_1)),rotated_img.append(rotate(sample_1))
shear_img.append(shear(sample_1)), blur_img.append(blur(sample_1)), gamma_img.append(gamma(sample_1))
row, col = 5, 5
plt.figure(2)
plt.subplot(row, col,1), plt.title('Shift'), plt.subplot(row, col,2), plt.title('Rotation')
plt.subplot(row, col,3), plt.title('Shear'), plt.subplot(row, col,4), plt.title('Blur')
plt.subplot(row, col,5), plt.title('Gamma')
for i in range(5):
pos = 5*i
plt.subplot(row, col,pos+1), plt.imshow(translated_img[i]), plt.axis('off')
plt.subplot(row, col,pos+2), plt.imshow(rotated_img[i]), plt.axis('off')
plt.subplot(row, col,pos+3), plt.imshow(shear_img[i]), plt.axis('off')
plt.subplot(row, col,pos+4), plt.imshow(blur_img[i]), plt.axis('off')
plt.subplot(row, col,pos+5), plt.imshow(gamma_img[i]), plt.axis('off')
for j in range(5):
pos=5*j
for i in range(8):
test = random_transform(sample_1)
plt.subplot(5, 7, pos+i+1), plt.imshow(test), plt.axis('off')
We have a way to generate additional data now. However, each class in dataset should have different needed amount of additional data.
# Based on that average, we can estimate how many images a traffic sign need to have
total_traffic_signs = len(set(y_train))
# Calculate how many images in one traffic sign
ts, imgs_per_sign = np.unique(y_train, return_counts=True)
avg_per_sign = np.ceil(np.mean(imgs_per_sign)).astype('uint32')
separated_data = []
for traffic_sign in range(total_traffic_signs):
images_in_this_sign = X_train[y_train == traffic_sign,...]
separated_data.append(images_in_this_sign)
# For each dataset, I generate new images randomly based on current total images
expanded_data = np.array(np.zeros((1, 32,32,3)))
expanded_labels = np.array([0])
for sign, sign_images in enumerate(separated_data):
scale_factor = (4*(avg_per_sign/imgs_per_sign[sign])).astype('uint32')
new_images = []
# Generate new images <---- Could apply list comprehension here
for img in sign_images:
for _ in range(scale_factor):
new_images.append(random_transform(img))
# Add old images and new images into 1 array
if len(new_images) > 0:
sign_images = np.concatenate((sign_images, new_images),axis=0)
new_labels = np.full(len(sign_images),sign, dtype ='uint8')
# Insert new_images to current dataset
expanded_data = np.concatenate((expanded_data,sign_images), axis = 0)
expanded_labels = np.concatenate((expanded_labels, new_labels), axis=0)
augmented_train = {'features': expanded_data, 'labels': expanded_labels}
augmented_X_train, augmented_y_train = augmented_train['features'], augmented_train['labels']
# Create a barchart of frequencies
item, count = np.unique(y_train, return_counts=True)
freq = np.array((item, count)).T
item2, count2 = np.unique(augmented_y_train, return_counts=True)
freq2 = np.array((item2, count2)).T
plt.figure(figsize=(15, 5))
before = plt.subplot(1,2, 1)
after = plt.subplot(1,2,2)
before.bar(item, count, alpha=0.4), after.bar(item2, count2, alpha=0.8)
before.set_title("Before: Unequally distributed data", size=12)
after.set_title("After: Equally distributed data", size=12)
### To start off let's do a basic data summary.
# Number of training examples
n_train = augmented_X_train.shape[0]
# Number of validation examples
n_validation = X_valid.shape[0]
# Number of testing examples
n_test = X_test.shape[0]
# What's the shape of an image?
image_shape = augmented_X_train[0].shape
# How many classes are in the dataset
n_classes = np.unique(augmented_y_train).shape[0]
print("Number of training examples =", n_train)
print("Number of validation examples =", n_validation)
print("Number of testing examples =", n_test)
print("Image data shape =", image_shape)
print("Number of classes =", n_classes)
X_train = augmented_X_train
y_train = augmented_y_train
is quite important that the data is shuffled to remove the influence of drifts within the data. I have managed to get quite a good validation accuracy without augmenting the data to create a much larger data set.
X_train, y_train = preprocess_data_shuffle(X_train, y_train)
X_test, y_test = preprocess_data_shuffle(X_test, y_test)
X_valid, y_valid = preprocess_data_shuffle(X_valid, y_valid)
I have implemented the Traffic Sign Recognition with Multi-Scale Convolutional Network using published baseline model on this problem. The model was implemented using TensorFlow-Slim. TF-Slim is a lightweight library for defining, training and evaluating complex models in TensorFlow. with the following differences:
I also tried various convolutional neural network architectures:
It takes a significant amount of effort to twick the filter sizes, strides, padding to be able to get the model to perform well.
In summary, my neural network architecture consists of the following 12 layers:
I used dropout on the fully-connected layers to prevent overfitting.
Batch normalization was applied after the convolutional layers, to (a) make the model more robust to bad random weight initialization, (b) allow higher learning rates, and (c) help with regularization. More details about batch normalization are availabe at https://arxiv.org/abs/1502.03167 and http://cs231n.github.io/neural-networks-2/#batchnorm
def conv_neural_net():
"""
Define Convolutional Neural Network Architecture
Return the relevant tensor references
"""
with tf.variable_scope('Convolutional_Neural_Network'):
# Tensors representing input images and labels
x = tf.placeholder('float', [None, IMG_SIZE, IMG_SIZE, NUM_CHANNELS])
y = tf.placeholder('float', [None, NUM_CLASSES])
# Placeholder for dropout keep probability
keep_prob = tf.placeholder(tf.float32)
# Use batch normalization for all convolution layers
with slim.arg_scope([slim.conv2d], normalizer_fn=slim.batch_norm):
# Given x shape is (32, 32, 3)
# Conv and pool layers
net = slim.conv2d(x, 16, [3, 3], scope='conv1') # output shape: (32, 32, 16)
net = slim.max_pool2d(net, [3, 3], 1, padding='SAME', scope='pool1') # output shape: (32, 32, 16)
net = slim.conv2d(net, 64, [5, 5], 3, padding='VALID', scope='conv2') # output shape: (10, 10, 64)
net = slim.max_pool2d(net, [3, 3], 1, scope='pool2') # output shape: (8, 8, 64)
net = slim.conv2d(net, 128, [3, 3], scope='conv3') # output shape: (8, 8, 128)
net = slim.conv2d(net, 64, [3, 3], scope='conv4') # output shape: (8, 8, 64)
net = slim.max_pool2d(net, [3, 3], 1, scope='pool3') # output shape: (6, 6, 64)
# Final fully-connected layers
net = tf.contrib.layers.flatten(net)
net = slim.fully_connected(net, 1024, scope='fc1')
net = tf.nn.dropout(net, keep_prob)
net = slim.fully_connected(net, 1024, scope='fc2')
net = tf.nn.dropout(net, keep_prob)
net = slim.fully_connected(net, NUM_CLASSES, scope='fc3')
# Final output (logits)
logits = net
# Loss function and optimizer
loss = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(logits=logits, labels=y))
optimizer = tf.train.GradientDescentOptimizer(learning_rate=learningrate).minimize(loss)
# Prediction (used during inference)
predictions = tf.argmax(logits, 1)
# Accuracy metric calculation
correct_prediction = tf.equal(predictions, tf.argmax(y, 1))
accuracy = tf.reduce_mean(tf.cast(correct_prediction, tf.float32))
# Return relevant tensor references
return x, y, keep_prob, logits, optimizer, predictions, accuracy
Describe how you trained your model:
To train the model, I used standard Stochastic Gradient Descent (SGD). I experimented with other optimizers like ADAM, but the performance was not good. I twicked the number of epochs ranging from 50 to 100 until I got a model validation accuracy of 96.16%. The learning rate remained unchanged throughout. I also adjusted the drop rate to adjust for overfitting from a value of 0.5 to 0.75 which resulted in very poor performance. I also tried to automate the process by using grid search hyperparameter tuning techniques on the learning rate, dropout rate, epochs and number of fully connected layers. This proved to be quite compute intensive, grid search ran for days and I had to abandon the idea until I had more computational resources. So I resorted to a random hyperparameter search method.
When choosing a training batch size, I kept the following in mind:
Thus I chose a middle ground between the two extremes. I was not methodical in this process of batch size tuning, due to time constraints, and the resulting performance optimization derived from of tuning the batch size did not seem high.
The number of epochs was chosen such that it is large enough to see the training and validation accuracies saturating. This means the model cannot improve anymore, given more training time.
The hyperparameters were chosen based on a random hyperparameter combination search. The code to perform the search is available in search_params.py
. In this process, I randomly chose 20 hyperparameter combinations, ran training on my model, and chose the hyperparameter combination that gave the highest test accuracy. ter combination was the best, since the test set should be "hidden" until the model has been finalized.
Looking at the plot of train vs. validation accuracy, we can see the validation accuracy is only slighly below the training accuracy throughout the training process, which is a good indication of model performance.
The model's accuracy on the official test set is 96.41%, which is a good score.
Below are my final settings and hyperparameters I used to train my model:
def train_network():
# Launch the graph
with tf.Graph().as_default(), tf.Session() as sess:
########################################################
# "Instantiate" neural network, get relevant tensors
########################################################
x, y, keep_prob, logits, optimizer, predictions, accuracy = conv_neural_net()
########################################################
# Training process
########################################################
# TF saver to save/restore trained model
saver = tf.train.Saver()
# This dumps summaries for TensorBoard
# Only dumping the graph, to visualize the architecture
train_writer = tf.summary.FileWriter('tf_summary/train', sess.graph)
if RESUME or RESTORE:
print('Restoring previously trained model at %s' % MODEL_SAVE_PATH)
# Restore previously trained model
saver.restore(sess, MODEL_SAVE_PATH)
# Restore previous accuracy history
with open('accuracy_history.p', 'rb') as f:
accuracy_history = pickle.load(f)
if RESTORE:
return accuracy_history
else:
print('Training model Convolutional Neural Network')
# Variable initialization
init = tf.global_variables_initializer()
sess.run(init)
# For book-keeping, keep track of training and validation accuracy over epochs, like such:
# [(train_acc_epoch1, valid_acc_epoch1), (train_acc_epoch2, valid_acc_epoch2), ...]
accuracy_history = []
# Record time elapsed for performance check
last_time = time.time()
train_start_time = time.time()
# Run NUM_EPOCH epochs of training
for epoch in range(NUM_EPOCH):
# Instantiate generator for training data
train_gen = next_batch(X_train, y_train, BATCH_SIZE, True)
#train_gen = next_batch(augmented_X_train, augmented_y_train, BATCH_SIZE, True)
#augmented_X_train, augmented_y_train
# How many batches to run per epoch
num_batches_train = math.ceil(X_train.shape[0] / BATCH_SIZE)
#num_batches_train = math.ceil(augmented_X_train.shape[0] / BATCH_SIZE)
# Run training on each batch
for _ in range(num_batches_train):
# Obtain the training data and labels from generator
images, labels = next(train_gen)
# Perform gradient update (i.e. training step) on current batch
sess.run(optimizer, feed_dict={x: images, y: labels, keep_prob: KEEP_PROB})
# Calculate training and validation accuracy across the *entire* train/validation set
# If train/validation size % batch size != 0
# then we must calculate weighted average of the accuracy of the final (partial) batch,
# w.r.t. the rest of the full batches
# Training set
train_gen = next_batch(X_train, y_train, BATCH_SIZE_INF, True)
train_size = X_train.shape[0]
train_acc = calculate_accuracy(train_gen, train_size, BATCH_SIZE_INF, accuracy, x, y, keep_prob, sess)
# Validation set
valid_gen = next_batch(X_valid, y_valid, BATCH_SIZE_INF, True)
valid_size = X_valid.shape[0]
valid_acc = calculate_accuracy(valid_gen, valid_size, BATCH_SIZE_INF, accuracy, x, y, keep_prob, sess)
# Record and report train/validation/test accuracies for this epoch
accuracy_history.append((train_acc, valid_acc))
# Print accuracy every 10 epochs
if (epoch+1) % 10 == 0 or epoch == 0 or (epoch+1) == NUM_EPOCH:
print('Epoch %d -- Train acc.: %.4f, Validation acc.: %.4f, Elapsed time: %.2f sec' %\
(epoch+1, train_acc, valid_acc, time.time() - last_time))
last_time = time.time()
total_time = time.time() - train_start_time
print('Total elapsed time: %.2f sec (%.2f min)' % (total_time, total_time/60))
# After training is complete, evaluate accuracy on test set
print('Calculating test accuracy...')
test_gen = next_batch(X_test, y_test, BATCH_SIZE_INF, False)
test_size = X_test.shape[0]
test_acc = calculate_accuracy(test_gen, test_size, BATCH_SIZE_INF, accuracy, x, y, keep_prob, sess)
print('Test acc.: %.4f' % (test_acc,))
if SAVE_MODEL:
# Save model to disk
save_path = saver.save(sess, MODEL_SAVE_PATH)
print('Trained model saved at: %s' % save_path)
# Also save accuracy history
print('Accuracy history saved at accuracy_history.p')
with open('accuracy_history.p', 'wb') as f:
pickle.dump(accuracy_history, f)
return accuracy_history
accuracy_history = train_network()
# Transpose accuracy_history
hist = np.transpose(np.array(accuracy_history))
plt.plot(hist[0], 'b') # training accuracy
plt.plot(hist[1], 'r') # validation accuracy
plt.title('Train (blue) and Validation (red) Accuracies over Epochs')
plt.ylabel('Accuracy')
plt.xlabel('Epoch')
plt.show()
To give yourself more insight into how your model is working, download at least five pictures of German traffic signs from the web and use your model to predict the traffic sign type.
You may find signnames.csv
useful as it contains mappings from the class id (integer) to the actual sign name.
# Read sample image files, resize them, convert to numpy arrays w/ dtype=uint8
image_files = ['sample_images/' + image_file for image_file in os.listdir('sample_images')]
images = []
for image_file in image_files:
image = Image.open(image_file)
image = image.convert('RGB')
image = image.resize((IMG_SIZE, IMG_SIZE), Image.ANTIALIAS)
image = np.array(list(image.getdata()), dtype='uint8')
image = np.reshape(image, (32, 32, 3))
images.append(image)
images = np.array(images, dtype='uint8')
# Visually inspect sample images
for i, image in enumerate(images):
plt.subplot(3, 3, i+1)
plt.imshow(image)
plt.title(image_files[i])
plt.tight_layout()
plt.show()
Even though my samples images have a bright resolution and high quality images. The quality of the images used for training, validation and testing are quite poor. Image quality has a effect on convolutional neural network model accuracy. According to this paper. Higher image quality will produce better prediction accuracy results.Understanding How Image Quality Affects Deep Neural Networks.
I could improve the predictions of the new image sample results by augmenting the validation iamge set.
# Load signnames.csv to map label number to sign string
label_map = {}
with open('signnames.csv', 'r') as f:
first_line = True
for line in f:
# Ignore first line
if first_line:
first_line = False
continue
# Populate label_map
label_int, label_string = line.split(',')
label_int = int(label_int)
label_map[label_int] = label_string
# Pre-process the image
images, _ = preprocess_data(images, np.array([0 for _ in range(images.shape[0])]))
with tf.Graph().as_default(), tf.Session() as sess:
# Instantiate the CONV NN model
x, y, keep_prob, logits, optimizer, predictions, accuracy = conv_neural_net()
# Load trained weights
saver = tf.train.Saver()
saver.restore(sess, MODEL_SAVE_PATH)
# Run inference on CNN to make predictions, and remember the logits for later
lgts, preds = sess.run([logits, predictions], feed_dict={x: images, keep_prob: 1.})
final_preds = [label_map[pred] for pred in preds]
# Print predictions on my sample images
print('Predictions on sample images\n')
for i in range(images.shape[0]):
print('%s --> %s' % (image_files[i], final_preds[i]))
Predictions on sample images
sample_images/children.jpg --> Children crossing This is the correct predicition
sample_images/wild_animal_crossing.jpg --> Wild animals crossing This is the correct predicition
sample_images/loose_gravel.jpg --> Yield This is not the correct predicition
sample_images/maximum_height_allowed.jpg --> Go straight or right This is not the correct predicition
sample_images/60_speedlimit.jpg --> Speed limit (60km/h) This is the correct predicition
The accuracy rate of the prediction is 60% (3/5)
Comparing the results to predicting on the test set
# Load the German Traffic Sign training set again
training_file = 'train.p'
with open(training_file, mode='rb') as f:
train = pickle.load(f)
X_train, y_train = train['features'], train['labels']
# For each of the 5 predictions,
# find an image in the test set that matches the predicted class
train_images = []
for pred in preds:
for i, y in enumerate(y_train):
if y == pred:
train_images.append(X_train[i])
break
# Display images from test set
for i, image in enumerate(train_images):
plt.subplot(3, 3, i+1)
plt.imshow(image)
plt.title(final_preds[i])
plt.tight_layout()
plt.show()
The test set has an accuracy of 100% compared to the new sample image prediction accuracy of 60%. This can be attributed to overfitting on the test set. The image quality is also a determining factor on these results.
# Use TensorFlow's softmax and top_k functions
with tf.Graph().as_default(), tf.Session() as sess:
logits = tf.placeholder('float', [None, NUM_CLASSES])
softmax = tf.nn.softmax(logits)
top_k_val, top_k_idx = tf.nn.top_k(softmax, k=5)
top_k_vals, top_k_idxs = sess.run([top_k_val, top_k_idx], feed_dict={logits: lgts})
def display_pred_certainty(image, top_k_val, top_k_idx):
print('Top 5 predictions for the following image (prediction: probability)')
# Convert top k indices into strings
top_k_pred = [label_map[idx] for idx in top_k_idx]
# Show the image for reference
plt.imshow(image)
plt.show()
for i in range(5):
print('%s: %.2f%%' % (top_k_pred[i].replace('\n', ''), top_k_val[i] * 100))
# Re-read sample images
image_files = ['sample_images/' + image_file for image_file in os.listdir('sample_images')]
images = []
for image_file in image_files:
image = Image.open(image_file)
image = image.convert('RGB')
image = image.resize((IMG_SIZE, IMG_SIZE), Image.ANTIALIAS)
image = np.array(list(image.getdata()), dtype='uint8')
image = np.reshape(image, (32, 32, 3))
images.append(image)
images = np.array(images, dtype='uint8')
i = 0
display_pred_certainty(images[i], top_k_vals[i], top_k_idxs[i])
i = 1
display_pred_certainty(images[i], top_k_vals[i], top_k_idxs[i])
i = 2
display_pred_certainty(images[i], top_k_vals[i], top_k_idxs[i])
i = 3
display_pred_certainty(images[i], top_k_vals[i], top_k_idxs[i])
It looks like the No passing sign hence the confusion
i = 4
display_pred_certainty(images[i], top_k_vals[i], top_k_idxs[i])
I obtained the above 5 images from a dataset of German traffic signs German Traffic Signs
# Read sample image files, resize them, convert to numpy arrays w/ dtype=uint8
image_files = ['sample_images_german/' + image_file for image_file in os.listdir('sample_images_german')]
images = []
for image_file in image_files:
image = Image.open(image_file)
image = image.convert('RGB')
image = image.resize((IMG_SIZE, IMG_SIZE), Image.ANTIALIAS)
image = np.array(list(image.getdata()), dtype='uint8')
image = np.reshape(image, (32, 32, 3))
images.append(image)
images = np.array(images, dtype='uint8')
# Visually inspect sample images
for i, image in enumerate(images):
plt.subplot(1, 5, i+1)
plt.imshow(image)
plt.title(image_files[i])
plt.tight_layout()
plt.show()
# Load signnames.csv to map label number to sign string
label_map = {}
with open('signnames.csv', 'r') as f:
first_line = True
for line in f:
# Ignore first line
if first_line:
first_line = False
continue
# Populate label_map
label_int, label_string = line.split(',')
label_int = int(label_int)
label_map[label_int] = label_string
# Pre-process the image (don't care about label, put dummy labels)
images, _ = preprocess_data(images, np.array([0 for _ in range(images.shape[0])]))
with tf.Graph().as_default(), tf.Session() as sess:
# Instantiate the CNN model
x, y, keep_prob, logits, optimizer, predictions, accuracy = conv_neural_net()
# Load trained weights
saver = tf.train.Saver()
saver.restore(sess, MODEL_SAVE_PATH)
# Run inference on CNN to make predictions, and remember the logits for later
lgts, preds = sess.run([logits, predictions], feed_dict={x: images, keep_prob: 1.})
final_preds = [label_map[pred] for pred in preds]
# Print predictions on my sample images
print('Predictions on sample images\n')
for i in range(images.shape[0]):
print('%s --> %s' % (image_files[i], final_preds[i]))
sample_images_german/padestrian_crosswalk_ahead.jpg --> Children crossing This is the correct prediction
sample_images_german/speed_limit_120.jpg --> Speed limit (120km/h) This is the correct prediction
sample_images_german/signal_lights_ahead.jpg --> Traffic signals This is the correct prediction
sample_images_german/road_work.jpg --> Road work This is the correct prediction
sample_images_german/no_uturns.jpg --> No passing This is not the correct prediction There are similarities though between the No U-turns traffic sign and the No passing sign. I can understand this misclassification.
Our prediction accuracy is 80%. The model accuracy has improved by 20% which is quite significantly from the previous prediction. As earlier referenced the image quality has an effect on the model accuracy. It would be also intersting to visualize softmax because I could see what is causing some of the misclassification.
# Use TensorFlow's softmax and top_k functions
with tf.Graph().as_default(), tf.Session() as sess:
logits = tf.placeholder('float', [None, NUM_CLASSES])
softmax = tf.nn.softmax(logits)
top_k_val, top_k_idx = tf.nn.top_k(softmax, k=5)
top_k_vals, top_k_idxs = sess.run([top_k_val, top_k_idx], feed_dict={logits: lgts})
# Re-read sample image files, resize them, convert to numpy arrays w/ dtype=uint8
image_files = ['sample_images_german/' + image_file for image_file in os.listdir('sample_images_german')]
images = []
for image_file in image_files:
image = Image.open(image_file)
image = image.convert('RGB')
image = image.resize((IMG_SIZE, IMG_SIZE), Image.ANTIALIAS)
image = np.array(list(image.getdata()), dtype='uint8')
image = np.reshape(image, (32, 32, 3))
images.append(image)
images = np.array(images, dtype='uint8')
def pred_certainty_str(top_k_val, top_k_idx):
# Convert top k indices into strings
top_k_pred = [label_map[idx] for idx in top_k_idx]
pcs = ''
for i in range(5):
pcs += '%s: %.2f%%\n' % (top_k_pred[i].replace('\n', ''), top_k_val[i] * 100)
return pcs
for i, image in enumerate(images):
plt.subplot(1, 5, i+1)
plt.imshow(image)
plt.xlabel(pred_certainty_str(top_k_vals[i], top_k_idxs[i]))
plt.tight_layout()
plt.show()
import seaborn as sns
for i, image in enumerate(images):
fig = plt.figure(figsize=(12,4))
plt.xlabel(pred_certainty_str(top_k_vals[i], top_k_idxs[i]))
sns.barplot(x = top_k_vals[i], y = top_k_idxs[i])
plt.tight_layout()
plt.show()
The prediction probabilities are good. I can understand why the model is getting confused about the No U-Turn sign does look quite similar to the No-Passing sign and also it appears that the No U-Turn was not included in this training set hence also the misclassification.


{% extends "layout.html" %} {% block content%}
Thank you for Subscribing to JOB FETCH, you will get now get updates when we publish new articles.


Build a mindset for success.
Meemo helps you transform your mindset with daily audio messages from personal coaches.
"If you change your mind,
you can change your life."
WALTER JAMES, PSYCHOLOGIST & PHILOSOPHER
Move fast and break habits


Values
May 20, 2015
In this week's cultural blog post, we were asked to think about some values which we consider important to us and how affirmation can help lead to success. After looking at a list of different values, the ones which I consider important are accomplishment, achievement, ambition, personal development, challenge, having a family, knowledge, peace, and wisdom.
All the values listed above are important to me. One which I think is very important is wisdom. In all aspects of my life, I'm always concerned about the making good choices. I believe that wisdom is the key to making good choices. With wisdom, you have good insight and you can think about things very well and make rational decisions. Without wisdom, I don't think some of these other values would make sense.
Values and Stereotype threat
In my last cultural blog post, I talked a bit about stereotype threat. According to some research carried out, one way to combat stereotype threat is through Affirmation. Affirmation is basically the assertion that something is true. In regards to stereotype threat, experiments have been conducted to support the claim that affirmation can be effective in combating stereotype threat. In order to do this, you need to recognize your self-worth and values that are important to you and be able to affirm them. With enough wisdom, you will be able to recognize when you feel a stereotype threat and remind yourself that your beyond that. Just think of those stereotypes as statistics. They're not always true. So just do you and don't pay attention to negative stereotypes.


Trident
Trident: IE browser to use the core, the core program in 1997 to be used for the first time in IE4, Microsoft is in the Mosaic code based on revised from, and to follow the current IE7. Trident is in fact open to a core, the core design of the interface is well-developed, so have many of the core using IE instead of the IE browser have emerged (such as Maxthon, The World, TT, GreenBrowser, AvantBrowser, etc.). In addition, for the convenience of many people referred to as direct as IE core (of course not rule out the possibility that some people are because they do not know the name of the kernel and had no choice but to say so).
- Internet Explorer
- Maxthon
- The World
- TT
- GreenBrowser
- AvantBrowser
Geckos
Netcape6 introduction of the core, and later the Mozilla FireFox is also used to the core, Geckos is characterized by a fully open-source, so that they can develop a very high level of the world's programmers can write code for their increased functionality.
- Mozilla Firefox
- Mozilla
- Netscape Navigator
- Konqueror
- Epiphany
- Galeon
- Seamonkey
- Dillo
- Kazehakase
- Netsurf
- Camino
Presto
Presto: the current use of Opera's core, the core of Opera7 in 2003 for the first time used, which is the rendering engine characteristics to optimize the speed to reach the extreme, and is currently recognized as the fastest Web browser within the browser Nuclear, but the price is at the expense of the compatibility of the page.
- Opera
Webkit
Webkit: Apple Computer's Safari browser used by the kernel. Webkit engine contains WebCore and JavaScriptCore engine layout analysis engine, both from KDE's KHTML and KJS engine derived, they are free software, under the authorization of the treaty in the GPL, while support for the BSD systems. Therefore, Webkit is also free software, developed at the same time the source code. In the area of security is not IE, Firefox constraints, the Safari browser at home or very safe. Google's current browser Chrome is also used in the core.
- Safari
- Chrome
Mozilla Firefox
Netcape6 introduction of the core, and later the Mozilla FireFox is also used to the core, Geckos is characterized by a fully open-source, so that they can develop a very high level of the world's programmers can write code for their increased functionality.


{% extends 'base.html' %} {% load static %} {% block ta %}
Upload a roster here. Roster files should be plain text with a student email per line.


libc++ Jacksonville Status
This is a temporary page; please check the c++1z status here
This page shows the status of the papers and issues that are expected to be adopted in Jacksonville.
The groups that have contributed papers:
- LWG - Library working group
- CWG - Core Language Working group
- SG1 - Study group #1 (Concurrency working group)
Paper Status
| Paper # | Group | Paper Name | Meeting | Status | First released version |
|---|
Library Working group Issues Status
| 2192 | Validity and return type of std::abs(0u) is unclear | Jacksonville | |
| 2253 | [arrays.ts] dynarray should state which container requirements aren't met | Jacksonville | |
| 2255 | [arrays.ts] dynarray constructor ambiguity | Jacksonville | |
| 2276 | Missing requirement on std::promise::set_exception | Jacksonville | |
| 2450 | (greater|less|greater_equal|less_equal)<void> do not yield a total order for pointers | Jacksonville | |
| 2520 | N4089 broke initializing unique_ptr<T[]> from a nullptr | Jacksonville | |
| 2522 | [fund.ts.v2] Contradiction in set_default_resource specification | Jacksonville | |
| 2523 | std::promise synopsis shows two set_value_at_thread_exit()'s for no apparent reason | Jacksonville | |
| 2537 | Constructors for priority_queue taking allocators should call make_heap | Jacksonville | |
| 2539 | [fund.ts.v2] invocation_trait definition definition doesn't work for surrogate call functions | Jacksonville | |
| 2545 | Simplify wording for bind without explicitly specified return type | Jacksonville | |
| 2557 | Logical operator traits are broken in the zero-argument case | Jacksonville | Complete |
| 2558 | [fund.ts.v2] Logical operator traits are broken in the zero-argument case | Jacksonville | Complete |
| 2559 | Error in LWG 2234's resolution | Jacksonville | |
| 2560 | is_constructible underspecified when applied to a function type | Jacksonville | |
| 2565 | std::function's move constructor should guarantee nothrow for reference_wrappers and function pointers | Jacksonville | |
| 2566 | Requirements on the first template parameter of container adaptors | Jacksonville | |
| 2571 | §[map.modifiers]/2 imposes nonsensical requirement on insert(InputIterator, InputIterator) | Jacksonville | |
| 2572 | The remarks for shared_ptr::operator* should apply to cv-qualified void as well | Jacksonville | |
| 2574 | [fund.ts.v2] std::experimental::function::operator=(F&&) should be constrained | Jacksonville | |
| 2575 | [fund.ts.v2] experimental::function::assign should be removed | Jacksonville | |
| 2576 | istream_iterator and ostream_iterator should use std::addressof | Jacksonville | Patch done; needs tests |
| 2577 | {shared,unique}_lock should use std::addressof | Jacksonville | |
| 2579 | Inconsistency wrt Allocators in basic_string assignment vs. basic_string::assign | Jacksonville | Patch Ready |
| 2581 | Specialization of <type_traits> variable templates should be prohibited | Jacksonville | |
| 2582 | §[res.on.functions]/2's prohibition against incomplete types shouldn't apply to type traits | Jacksonville | |
| 2583 | There is no way to supply an allocator for basic_string(str, pos) | Jacksonville | |
| 2585 | forward_list::resize(size_type, const value_type&) effects incorrect | Jacksonville | |
| 2586 | Wrong value category used in scoped_allocator_adaptor::construct() | Jacksonville | |
| 2590 | Aggregate initialization for std::array | Jacksonville |
Comments about the issues
- 2192 -
- 2253 - Arrays.ts is moribund. No action needed.
- 2255 - Arrays.ts is moribund.  I tried making a sublass of istringstream, but it got sliced.
- 2577 - This one is simple
- 2579 - Done.
- 2581 -
- 2582 -
- 2583 - This looks easy.
- 2585 - This looks easy.
- 2586 -
- 2590 -
Last Updated: 16-Feb-2015


The Beauty of Science
I draw inspiration from creativity in science, and the ability to take and manipulate the science to benefit society. I also draw creativity from great leaders of our times. Phil Jackson, he brought Zen into the chaotic environment, Colin Powel, Madeline Albirght (God knows I want to meet her).
However, even though I am an engineer by training, some days, I feel like I am more of a scientist than an engineer, other days, I am a math whiz, coz I am fascinated by numbers. That which can amount to an absolute and even show a trend, that could predict what your shopping habits could be in the future, or used to preserve a product such that you can consume it at later date.
However, careewise I settled to being an Engineer, because I figured one can combined the science(exploring), engineering (application) and math (analysis) to invent, innovate and analysis to solve daunting problems.
You see, education, has always come easy to me, there is not a subject that I never excelled, whether it was history or physical education. I grasp things quick, I work quickly, and then I need to move to the next challenging thing. In essence, I need to be high on challenge. I am inhrently a problem-solver.


Co-Founder / Business Developer • 2009 - 2016
I have co-founded N2Clic Ltd., a web development agency, where I took care, among other things, of business development, project management and PR. Read more >
Co-Founder / Developer • 2012 - 2016
I have co-founded ThemeAvenue as a subsidiary of N2Clic Ltd. While ThemeAvenue was originally a theme shop, we quickly shifted towards the development and distribution of a single product: Awesome Support, a helpdesk software for WordPress. I sold Awesome Support in 2016 for a 2.7 multiple (read more here), which is above industry average. Read more >
Co-Founder / Marketing Manager • 2011 - 2014
I have co-founded RueduTheme, a French marketplace selling website themes. I was in charge of the company's marketing strategy and execution.
Online Marketing Manager • 2010 - 2012
As the online marketing manager at Kalistick (acquired by Coverity), I was in charge of developing our online presence, improving our lead generation and tracking KPIs. I was also involved in planning the global marketing strategy.
Business Developer • 2008 - 2009
I worked on three primary projects at Acteasy: development of a new subsidiary, improvement of management workflow, development and implementation of a CRM.
Bachelor in Business Administration, Management and Operations • 2009
I graduated «GEA» which stands for the French translation of «Management of Businesses and Administrations». I majored in IT Business.
Higher National Certificate in International Trade Relations • 2008
Foundations in international law and world economy. The advanced fields of study are management, transport and logistics. I completed three internships during my HNC training. Two internships in France and one in London, UK. I was working as Export Assistant in all three internships.
A-Level in Math, Physics, Biology • 2006


--- layout: post title: Ruby Hero Awards 2010 categories: - activism author: Gregg Pollack published: true date: 2010-03-30 11:41:00.000000000 +01:00 ---
It’s that time again to take a moment to think about those people who have impacted Ruby community but have not received the recognition they deserve. We have given away twelve awards in the past two years at Railsconf, and this year we are preparing to give away six more.
So, if you know someone who has contributed to our community this year please take a moment to show some gratitude by nominating them on RubyHeroes.com. A month from now the Ruby Heroes from last year will look at the nominations and decide who should receive the awards (this way there’s no popularity contest). However, your nominations do matter, so please take a moment and spread the gratitude.
The winners will be announced live on stage at Railsconf 2010, and posted here shortly there after.


This PhD project, funded by through the Transdisciplinary Global Health programme (European Commission - Erasmus Mundus), will be carried out from 2016 to 2018.
The research team is hosted at ISGlobal (Barcelona, Spain), CISM (Manhiça, Mozambique) and the VU (Amsterdam, Netherlands).
This is a project whose purpose is the generation of knowledge and presentation of evidence regarding the feasibility and suitability of foreign investment to finance the elimination of malaria in southern Mozambique.
This project aims to explore the impact - in both health and economic terms - of foreign investment in malaria control. It strives to follow a transdisciplinary approach to tackle a multitude of factors asociated with this complex topic. Specifically, those include (but are not limited to) a characterization of current foreign investment in the country; interest and availability of foreign investors to finance malaria elimination; burden of malaria among workers and its impact on productivity (and, by extension, economic growth); and community preferences on malaria control tools.
This projects aims to address the following questions:


Book a free smart contract audit consultation call
Consultancy
Select a time from our calendar for your free Smart Contract Audit consultation
Select a time from our calendar for your free Smart Contract Audit consultation
Get the latest QuillAudits smart contract audit guidelines , events, blogs sent straight to your inbox every week.


We at Co-working want to transform real estate into a beautiful and premium workspace.Co-working is the leading Indian coworking startup which aspires to be world’s #1 coworking and co-living workspace provider.
We are committed to delivering excellence through design and experience. We boast of a premium work culture with coworking centres spread across major cities throughout the country. Come and revolutionise work at Co-working!
At Nestaway we soon realized that it was necessary to go beyond basics and create a platform that could do much more than just solve the immediate problems of space and peripherals. With globalization and communication taking a forefront, we are aware that society is becoming more disparate.Our response to this is - No city should be a stranger; no person should feel discriminated.


Ashfield appoints new UK head of patient solutions
Stephanie Hill strengthens the commercial team at leading healthcare network
Ashfield, a leader in commercialisation services for the healthcare industry, has appointed Stephanie Hill (pictured above) as its new head of patient solutions in the UK.
She has over 17 years of experience in the healthcare industry, having first joined Ashfield in 2002 as a nurse advisor.
Since then, she has worked across a number of therapy areas, and supported patients with long term conditions and rare diseases.
Following a stint of working in client and provider roles, Hill re-joined Ashfield in 2016 as an international programme director.
In that role, she supported the design, implementation and management of patient support programmes for various brand launches across Europe.
She has also worked with many key opinion leaders (KOLs) and facilitated advisory boards to aid the delivery of new models of patient care pathways, and was the winner of the PMEA 2013 ‘Best Homecare Programme’ award.
“Following our investment in Salesforce Health Cloud, our Patient Solutions offering for our clients is stronger than ever. I’m looking forward to working with Steph to further differentiate our offering in line with our client’s needs,” said Mick O’Leary, regional president for Ashfield Commercial and Patient Solutions.


I'm Miguel Barragan, 20 years old, student at UPM university in Spain. I am in my third year of computer engineering and also working on my own projects. Such as Videogames with Unity, doing also my own art and music. I've been doing magic for about 2 years, skating 1 and a half years, learning to play the piano these days. I've developed webs, mobile apps and videogames through out the past 2 years. I've participated in several game Jams and hackathons. I have published 1 one on the play store called "Over the Sky".


Societies ({{ results.societies.length }}) — Return to the search page to refine or add to your results


A students group for the course of Software Engineering at the University of Padua 2013/2014.
Here we are, in alphabetical order:
Everything that you may see here was made with our framework Maaperture, check it out:


--- imgsrc: "jewish_art_jacob_wrestling_angel_israel_will_deutsch.jpg" buylink: "http://store.notesfromthetribe.com/product/jewish-art-8-5-x11-jacob-wrestling-angel-print" postDate: "04.13.11" layout: post ---
Jacob wrestled with an angel all evening and at daybreak let him go after his hip was wrenched. For struggling and overcoming both God and man, he was blessed and given the name ‘Israel’.
I had my pants pulled down in second grade by some cruel classmates who wanted to embarrass me during a rainy day assembly. Because the entire school saw, I was given the name ‘Little Willy’.
Sometimes life just isn’t fair.


IDF gears up for massive Shabbat gathering in Hevron
Security preparations underway as tens of thousands of Jews expected to flock to Hevron for annual 'Hevron Shabbat'.
by Arutz Sheva StaffThe IDF and Border Police have deployed extra units in the city of Hevron, in Judea, to secure this weekend’s ‘Hevron Shabbat’, as tens of thousands of Israelis head to the biblical city for what has become a popular annual pilgrimage.
Every year, thousands of Jews gather in Hevron and the adjoining town of Kiryat Arba for the ‘Hevron Shabbat’, held on the Sabbath corresponding with the ‘Chayei Sarah’ Torah portion from the Book of Genesis.
Spanning Genesis 23:1 to 25:18, the Chayei Sarah portion details Abraham’s purchase of a burial place in the city of Hevron for his wife, Sarah.
Since the Cave of Machpelah, better known today as the Tomb of the Patriarchs, is mentioned in the portion, in recent years, the Sabbath during which Chayei Sarah is read in synagogues has become a popular pilgrimage to Hevron and Kiryat Arba.
Last year, more than 40,000 Jews stayed in Hevron for Shabbat Hevron, and similar numbers are expected to visit this weekend.
The entire Tomb of the Patriarchs complex will be open to Jewish visitors during Shabbat Hevron. For most of the year, most of the complex is reserved for Muslim prayer services, with Jewish access limited to a single hall.
Hundreds of Border Police officers and IDF soldiers will be deployed to Hevron over the weekend, securing the Jewish neighborhoods in Hevron as well as tours planned in the city.


Flexplorer
align-items
flex-start
flex-end
center
baseline
stretch
justify-content
flex-start
flex-end
center
space-between
space-around
space-evenly
flex-direction
row
column


Don't worry, we can't find your page, but if you hit that back arrow once or go to our main page, you can be happy again!
404 (Not Found)


Puppet Samba Module
Module for provisioning Samba
Usage
See reference and examples
Reference
Reference documentation is generated directly from source code using puppet-strings. You may regenerate the documentation by running:
bundle exec puppet strings
The documentation is no substitute for reading and understanding the module source code, and all users should ensure they are familiar and comfortable with the operations this module performs before using it.
License
This module is released under the MIT license:
Limitations
-
Not supported by Puppet, Inc.
Development
PRs accepted :)
Testing
This module supports testing using PDQTest.
Test can be executed with:
bundle install
make
See .travis.yml
for a working CI example
Acknowledgements
Based on an original module hosted at github.com/ajjahn/puppet-samba. Since upstream looks dormant, I created a new module updated for Puppet 4 and including a customer patch.
The authors below were obtained from the project's git history and they are acknowledged here as co-authors:
-
Adam Jahn
-
Adrian Joian
-
Alexander Fisher
-
Artem Sidorenko
-
Christian Depner
-
Christian Döring
-
Daniel Sung
-
David Sheldon
-
erik-smit
-
gnieark
-
Hielke Jager
-
Iban Nieto
-
Jan Čapek
-
Jan Kanis
-
Jirgn Mssnr
-
John Hodrien
-
jonoterc
-
Kai Stian Olstad
-
Kurt Gardiner
-
Lebedev Vadim
-
Marc
-
Mark Phillips
-
Myles Steinhauser
-
Niklaus Giger
-
Pete Brown
-
Philipp Tölke
-
root
-
sauce@freenode
-
Timothy M Pollard
-
Tomas Edwardsson
-
Vladimir Rutsky
-
Vladislav Nazarenko


|
|
Rock, Paper or Scissor Game - Train and Classify [Orange] |
| Tags | train_and_classify☁machine-learning☁features☁train☁nearest-neighbour☁orange |
Through the set of 4 Jupyter Notebooks (referred on the list below) that are part of our "Rock, Paper or Scissor Classification Game" a reasonable understanding of the different Machine Learning stages, that need to be followed in order to train an effective classification system, can be reached.
Previous Notebooks that are part of "Rock, Paper or Scissor Game - Train and Classify" module
All the previous Jupyter Notebooks are focused on the application of scikit-learn ( Python ) functionalities.
However Anaconda toolbox (presented at Download, Install and Execute Anaconda ) includes a very intuitive and graphical resource called Orange , that can be an interesting tool to complement our 4 volumes of "Rock, Paper or Scissor Game - Train and Classify" module
On the current Jupyter Notebook it will be done a very quick presentation of Orange
PR - Installation of
Orange
through
Anaconda
PR1 - Launch
Anaconda Navigator
PR2 - Click on "Install" button below the Orange icon
PR3 - Please, wait a few moments for the end of installation procedure
When the installation is finished the "Launch" button becomes available below Orange icon !
1 - Start Orange by clicking on "Launch" button
2 - Click on "New" icon in order to create a new project
For training our classifier we need to be in possession of training data, i.e., multiple training examples of each class objectively described by a set of features (as demonstrated at Rock, Paper or Scissor Game - Train and Classify [Volume 2] | Feature Extraction )
In the following steps we will try to replicate, using Orange , the training process of a k-Nearest Neighbour classifier ( Rock, Paper or Scissor Game - Train and Classify [Volume 3] | Train and Classify ) and the performance evaluation of the trained system ( Rock, Paper or Scissor Game - Train and Classify [Volume 4] | Performance Evaluation ).
As a starting point, we will use the extracted list of features on Rock, Paper or Scissor Game - Train and Classify [Volume 2] | Feature Extraction .
⚠ The features list file should be in a compatible format to be read by Orange . For our example we choose .tab file format, where each row j represents a training example and each column i (consecutive columns are separated by a tab ) contains the value of the feature number j for the respective training examples i .
Below, it is shown our file with 20 training examples (number of rows) and the 13 selected features (number of columns).
3 - Import a file, with training example data, into Orange
Click on "File" icon located at "Data" tab
4 - Double-click the new "File" icon added to our workspace
A new screen will appear, which enables the specification of features file location !
5 - Specify which column contain the target variable (list with class labels of each training example)
Scroll down the list until finding the target variable. Then change the "Role" to target .
6 - Define a name for each column/feature
It is really simple, at each row you only need to double-click on the predefined name and the edit functionality will be automatically enabled.
7 - After renaming all the features, close the window in order to confirm your choices and proceed the configuration procedure
8 - For visualising how different pairs of variables are "separating" the four classes, let"s explore a visualisation functionality of
Orange
8.1 - Access
Visualize
tab
8.2 - Click on "Scatter Plot" icon
8.3 - Link the two elements "File" and "Scatter Plot"
8.4 - Double-click on "Scatter Plot" icon for visualising the distribution of classes for each pair of features
9 - After preparing our classification environment we can select our model and advance to the respective training
The selected model was the k-Nearest Neighbour classifier ( Rock, Paper or Scissor Game - Train and Classify [Volume 3] | Train and Classify )
9.1 - Access Model tab
Located at the left side of Orange window.
9.2 - Drag kNN icon to the working environment
9.3 - Double-click on kNN icon for prompting the configuration window of our model
We will keep the predefined values, choosing k (number of neighbours) as 5 and the "Euclidean Norm" to estimate the distance between testing point and training examples.
9.4 - Link "File" icon with "kNN" icon
With this operation we are specifying the inputs (training data) that will be used to train our model.
10 - There is only one step remaining... "Evaluation" our classifier
Repeating the methodology of Rock, Paper or Scissor Game - Train and Classify [Volume 4] | Performance Evaluation , we will use a Leave One Out Strategy to test the accuracy of our classifier.
10.1 - Open "Evaluate" tab
Located at the left side of Orange window.
10.2 - Drag "Test & Score" to the working environment
10.3 - Link "File" and "kNN" icons with "Test & Score" icon
Essentially what we are doing is specifying which is the training data and the model that will be fitted to it.
10.4 - Double-click on "Test & Score" icon to reach the testing results screen
10.5 - Specify the desired test procedure
Like previously referred, we will choose "Leave One Out" strategy
A "Classification Accuracy" of 90 % was obtained, which is identical to the obtained value at Rock, Paper or Scissor Game - Train and Classify [Volume 4] | Performance Evaluation when a set with less features is used.
We reach the end of our introductory journey through Orange environment and, as you can see, it is amazing and extremely intuitive.
However we only explored a small fraction of the full capabilities of this environment.
With the previous steps the contents described on "Classification Game" Volumes 2 to 4 are replicated through a more graphical perspective.
We hope that you have enjoyed this guide. biosignalsnotebooks is an environment in continuous expansion, so don"t stop your journey and learn more with the remaining Notebooks !


public class Date
extends java.lang.Object
| Constructor and Description |
|---|
Date(Date other)
copy constructor
|
Date(int day,
int month,
int year)
creates a new Date object if the date is valid, otherwise creates the date 1/1/2000
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
after(Date other)
check if this date is after other date
|
boolean |
before(Date other)
check if this date is before other date
|
int |
dayInWeek()
calculate the day of the week that this date occurs on 0-Saturday 1-Sunday 2-Monday etc.
|
int |
difference(Date other)
calculates the difference in days between two dates
|
boolean |
equals(Date other)
check if 2 dates are the same
|
int |
getDay()
gets the Day
|
int |
getMonth()
gets the month
|
int |
getYear()
gets the year
|
void |
setDay(int dayToSet)
sets the day (only if date remains valid)
|
void |
setMonth(int monthToSet)
set the month (only if date remains valid)
|
void |
setYear(int yearToSet)
sets the year (only if date remains valid)
|
java.lang.String |
toString()
returns a String that represents this date
|
public Date(Date other)
other
- the date to be copiedpublic Date(int day, int month, int year)
day
- the day in the month (1-31)month
- the month in the year (1-12)year
- the year (4 digits)public boolean after(Date other)
public boolean before(Date other)
public int dayInWeek()
public int difference(Date other)
other
- the date to calculate the difference betweenpublic boolean equals(Date other)
public int getDay()
public int getMonth()
public int getYear()
public void setDay(int dayToSet)
dayToSet
- the day value to be setpublic void setMonth(int monthToSet)
monthToSet
- the month value to be setpublic void setYear(int yearToSet)
yearToSet
- the year value to be setpublic java.lang.String toString()
toString
in class java.lang.Object


Forgot & Change Password!
Passwords must be between 6 and 12 characters long, containing at least one letter and one number. Please note, passwords are case sensitive.


71 Besides the list block in the example above, other blocks into which you may want to put procedures are set (to set the value of a variable to a procedure), say and think (to display a procedure to the user), and report (for a reporter that reports a procedure): E. Special Forms The primitive if else block has two C-shaped command slots and chooses one or the other depending on a Boolean test. Because Scratch doesn’t emphasize functional programming, it lacks a corresponding reporter block to choose between two expressions. Snap ! has one, but we could write our own: Our block works for these simple examples, but if we try to use it in writing a recursive operator, it’ll fail: The problem is that when any block is called, all of its inputs are computed (evaluated) before the block itself runs. The block itself knows only the values of its inputs, not what expressions were used to compute them. In particular, all of the inputs to our if then else block are evaluated ﬁrst thing. That means that even in the base case, factorial will try to call itself recursively, causing an inﬁnite loop. We need our if then else block to be able to select only one of the two alternatives to be evaluated. We have a mechanism to allow that: declare the then and else inputs to be of type Reporter rather than type Any. Then, when calling the block, those inputs will be enclosed in a ring so that the expressions themselves, rather than their values, become the inputs: In this version, the program works, with no inﬁnite loop. But we’ve paid a heavy price: this reporter-if is no longer as intuitively obvious as the Scratch command-if. You have to know about procedures as data, about rings, and about a trick to get a constant value in a ringed slot. (The id block implements the identity function,


Online Python Tutor supports Python 2.7 and 3.3, Java 7, JavaScript ES5 strict, and TypeScript 1.4.1 with limited module imports and no file I/O.
Have a question? Maybe the FAQ or other documentation can help. Or check out its code at GitHub.
Email Philip Guo at<EMAIL_ADDRESS>for all support questions.
By using Online Python Tutor, your visualized code, options, and IP address are logged on our server and may be analyzed for research purposes. Nearly all Web services collect this basic information from users. However, Online Python Tutor does not collect any personal information, cookies, or session state from users.
Copyright © Philip Guo. All rights reserved.