Before Change
def slice(x, start, size):
raise NotImplementedError
def pattern_broadcast(x, broadcastable):
return T.patternbroadcast(x, broadcastable)
After Change
def slice(x, start, size):
if not (len(int_shape(x)) == len(start) == len(size)):
raise ValueError("The dimension and the size of indices should match.")
out = x[tuple([py_slice(i, i + j) for (i, j) in zip(start, size)])]
out._keras_shape = tuple(size)
return out
def pattern_broadcast(x, broadcastable):
return T.patternbroadcast(x, broadcastable)
// VALUE MANIPULATION
def get_value(x):
if not hasattr(x, "get_value"):
raise TypeError("`get_value` can only be called on a variable. "
"If you have an expression instead, use `eval()`.")
return x.get_value()
def batch_get_value(xs):
Returns the value of more than one tensor variable,
as a list of Numpy arrays.
return [get_value(x) for x in xs]
def set_value(x, value):
x.set_value(np.asarray(value, dtype=x.dtype))
def batch_set_value(tuples):
for x, value in tuples:
x.set_value(np.asarray(value, dtype=x.dtype))
def get_variable_shape(x):
return x.get_value(borrow=True, return_internal_type=True).shape
def print_tensor(x, message=""):
Print the message and the tensor when evaluated and return the same
tensor.
p_op = Print(message)
return p_op(x)
// GRAPH MANIPULATION
class Function(object):
def __init__(self, inputs, outputs, updates=[], name=None, **kwargs):
unique_variables_to_update = {}
for v, nv in updates:
if v not in unique_variables_to_update:
unique_variables_to_update[v] = nv
updates = unique_variables_to_update.items()
self.function = theano.function(inputs, outputs, updates=updates,
allow_input_downcast=True,
on_unused_input="ignore",
name=name,
**kwargs)
self.name = name
def __call__(self, inputs):
assert isinstance(inputs, (list, tuple))
return self.function(*inputs)
def _raise_invalid_arg(key):
msg = "Invalid argument "%s" passed to K.function with Theano backend" % key
raise ValueError(msg)
def function(inputs, outputs, updates=[], **kwargs):
if len(kwargs) > 0:
for key in kwargs.keys():
if not has_arg(theano.function, key, True):
_raise_invalid_arg(key)
return Function(inputs, outputs, updates=updates, **kwargs)
def gradients(loss, variables):
return T.grad(loss, variables)
def stop_gradient(variables):
Returns `variables` but with zero gradient w.r.t. every other variable.
// Arguments
variables: tensor or list of tensors to consider constant with respect
to any other variable.
// Returns
A single tensor or a list of tensors (depending on the passed argument)
that has constant gradient with respect to any other variable.
if isinstance(variables, (list, tuple)):
return map(theano.gradient.disconnected_grad, variables)
else:
return theano.gradient.disconnected_grad(variables)
// CONTROL FLOW
def rnn(step_function, inputs, initial_states,
go_backwards=False, mask=None, constants=None,
unroll=False, input_length=None):
Iterates over the time dimension of a tensor.
// Arguments
step_function:
Parameters:
inputs: Tensor with shape (samples, ...) (no time dimension),
representing input for the batch of samples at a certain
time step.
states: List of tensors.
Returns:
outputs: Tensor with shape (samples, ...) (no time dimension),
new_states: List of tensors, same length and shapes
as "states".
inputs: Tensor of temporal data of shape (samples, time, ...)
(at least 3D).
initial_states: Tensor with shape (samples, ...) (no time dimension),
containing the initial values for the states used in
the step function.
go_backwards: Boolean. If True, do the iteration over the time
dimension in reverse order and return the reversed sequence.
mask: Binary tensor with shape (samples, time),
with a zero for every element that is masked.
constants: A list of constant values passed at each step.
unroll: Whether to unroll the RNN or to use a symbolic loop
(`while_loop` or `scan` depending on backend).
input_length: Static number of timesteps in the input.
Must be specified if using `unroll`.
// Returns
A tuple (last_output, outputs, new_states).
last_output: The latest output of the rnn, of shape `(samples, ...)`
outputs: Tensor with shape `(samples, time, ...)` where each
entry `outputs[s, t]` is the output of the step function
at time `t` for sample `s`.
new_states: List of tensors, latest states returned by
the step function, of shape `(samples, ...)`.
ndim = inputs.ndim
assert ndim >= 3, "Input should be at least 3D."
if unroll:
if input_length is None:
raise ValueError("When specifying `unroll=True`, "
"an `input_length` "
"must be provided to `rnn`.")
axes = [1, 0] + list(range(2, ndim))
inputs = inputs.dimshuffle(axes)
if constants is None:
constants = []
global uses_learning_phase
uses_learning_phase = False
if mask is not None:
if mask.ndim != 2:
raise ValueError(
"mask should have `shape=(samples, time)`, "
"got {}".format(mask.shape))
mask = mask.dimshuffle([1, 0])
def get_matching_mask(mask_t, ref_tensor_t):
// tf.where needs its condition tensor
// to be the same shape as its two
// result tensors
ndim = ref_tensor_t.ndim
for _ in range(ndim - 1):
mask_t = expand_dims(mask_t)
add_shape = ref_tensor_t.shape[1:]
reps = T.concatenate([[1], add_shape], 0)
return T.tile(mask_t, reps, ndim=ndim)
if unroll:
indices = list(range(input_length))
if go_backwards:
indices = indices[::-1]
successive_outputs = []
successive_states = []
states = initial_states
for i in indices:
output, new_states = step_function(inputs[i], states + constants)
if getattr(output, "_uses_learning_phase", False):
uses_learning_phase = True
if len(successive_outputs) == 0:
prev_output = zeros_like(output)
else:
prev_output = successive_outputs[-1]
output_mask = get_matching_mask(mask[i], output)
output = T.switch(output_mask, output, prev_output)
kept_states = []
for state, new_state in zip(states, new_states):
state_mask = get_matching_mask(mask[i], state)
kept_states.append(T.switch(state_mask, new_state, state))
states = kept_states
successive_outputs.append(output)
successive_states.append(states)
outputs = T.stack(*successive_outputs)
states = []
for i in range(len(successive_states[-1])):
new_states = []
for states_at_step in successive_states:
new_states.append(states_at_step[i])
states.append(T.stack(*new_states))
else:
// build an all-zero tensor of shape (samples, output_dim)
initial_output = step_function(inputs[0], initial_states + constants)
initial_output = initial_output[0] * 0
// Theano gets confused by broadcasting patterns in the scan op
initial_output = T.unbroadcast(initial_output, 0, 1)
if len(initial_states) > 0:
initial_states[0] = T.unbroadcast(initial_states[0], 0, 1)
def _step(inputs, mask, output_tm1, *states):
outputs, new_states = step_function(inputs, states)
if getattr(outputs, "_uses_learning_phase", False):
global uses_learning_phase
uses_learning_phase = True
// output previous output if masked.
output_mask = get_matching_mask(mask, outputs)
outputs = T.switch(output_mask, outputs, output_tm1)
return_states = []
for state, new_state in zip(states, new_states):
state_mask = get_matching_mask(mask, state)
return_states.append(T.switch(state_mask, new_state, state))
return [outputs] + return_states
results, _ = theano.scan(
_step,
sequences=[inputs, mask],
outputs_info=[initial_output] + initial_states,
non_sequences=constants,
go_backwards=go_backwards)
// deal with Theano API inconsistency
if isinstance(results, list):
outputs = results[0]
states = results[1:]
else:
outputs = results
states = []
else:
if unroll:
indices = list(range(input_length))
if go_backwards:
indices = indices[::-1]
successive_outputs = []
successive_states = []
states = initial_states
for i in indices:
outputs, states = step_function(inputs[i], states + constants)
if getattr(outputs, "_uses_learning_phase", False):
uses_learning_phase = True
successive_outputs.append(outputs)
successive_states.append(states)
outputs = T.stack(*successive_outputs)
states = []
for i in range(len(successive_states[-1])):
states.append(T.stack(
*[states_at_step[i] for states_at_step in successive_states]))
else:
def _step(inputs, *states):
outputs, new_states = step_function(inputs, states)
if getattr(outputs, "_uses_learning_phase", False):
global uses_learning_phase
uses_learning_phase = True
return [outputs] + new_states
// Theano likes to make shape==1 dimensions
// in the initial states (outputs_info) broadcastable
if len(initial_states) > 0:
initial_states[0] = T.unbroadcast(initial_states[0], 0, 1)
results, _ = theano.scan(
_step,
sequences=inputs,
outputs_info=[None] + initial_states,
non_sequences=constants,
go_backwards=go_backwards)
// deal with Theano API inconsistency
if isinstance(results, list):
outputs = results[0]
states = results[1:]
else:
outputs = results
states = []
outputs = T.squeeze(outputs)
last_output = outputs[-1]
axes = [1, 0] + list(range(2, outputs.ndim))
outputs = outputs.dimshuffle(axes)
states = [T.squeeze(state[-1]) for state in states]
last_output._uses_learning_phase = uses_learning_phase
return last_output, outputs, states
def switch(condition, then_expression, else_expression):
Switches between two operations depending on a scalar value.
Note that both `then_expression` and `else_expression`
should be symbolic tensors of the *same shape*.
// Arguments
condition: scalar tensor (`int` or `bool`).
then_expression: either a tensor, or a callable that returns a tensor.
else_expression: either a tensor, or a callable that returns a tensor.
// Returns
The selected tensor.
if callable(then_expression):
then_expression = then_expression()
if callable(else_expression):
else_expression = else_expression()
cond_ndim = ndim(condition)
expr_ndim = ndim(then_expression)
if cond_ndim < expr_ndim:
ndim_diff = expr_ndim - cond_ndim
for _ in range(ndim_diff):
condition = expand_dims(condition)
return T.switch(condition, then_expression, else_expression)
def in_train_phase(x, alt, training=None):
Selects `x` in train phase, and `alt` otherwise.
Note that `alt` should have the *same shape* as `x`.
// Returns
Either `x` or `alt` based on the `training` flag.
the `training` flag defaults to `K.learning_phase()`.
if training is None:
training = learning_phase()
uses_learning_phase = True
else:
uses_learning_phase = False
if training is 1 or training is True:
if callable(x):
return x()
else:
return x
elif training is 0 or training is False:
if callable(alt):
return alt()
else:
return alt
if callable(x):
x = x()
if callable(alt):
alt = alt()
// else: assume learning phase is a placeholder tensor.
x = ifelse(training, x, alt)
if uses_learning_phase:
x._uses_learning_phase = True
return x
def in_test_phase(x, alt, training=None):
Selects `x` in test phase, and `alt` otherwise.
Note that `alt` should have the *same shape* as `x`.
// Returns
Either `x` or `alt` based on `K.learning_phase`.
return in_train_phase(alt, x, training=training)
// NN OPERATIONS
def _assert_has_capability(module, func):
if not hasattr(module, func):
raise EnvironmentError(
"It looks like like your version of "
"Theano is out of date. "
"Install the latest version with:\n"
"pip install git+git://github.com/Theano/Theano.git "
"--upgrade --no-deps")
def elu(x, alpha=1.0):
Exponential linear unit
// Arguments
x: Tensor to compute the activation function for.
alpha: scalar
_assert_has_capability(T.nnet, "elu")
return T.nnet.elu(x, alpha)
def relu(x, alpha=0., max_value=None, threshold=0.):
_assert_has_capability(T.nnet, "relu")
if alpha != 0.:
if threshold != 0.:
negative_part = T.nnet.relu(-x + threshold)
else:
negative_part = T.nnet.relu(-x)
if threshold != 0.:
x = x * T.cast(T.gt(x, threshold), floatx())
else:
x = T.nnet.relu(x)
if max_value is not None:
x = T.clip(x, 0.0, max_value)
if alpha != 0.:
x -= alpha * negative_part
return x
def softmax(x, axis=-1):
if (axis == -1 or axis == x.ndim - 1) and x.ndim == 2:
return T.nnet.softmax(x)
xm = x.max(axis=axis, keepdims=True)
return T.exp(x - xm) / T.exp(
x - xm).sum(axis=axis, keepdims=True)
def softplus(x):
return T.nnet.softplus(x)
def softsign(x):
return T_softsign(x)
def categorical_crossentropy(target, output, from_logits=False, axis=-1):
output_dimensions = list(range(len(int_shape(output))))
if axis != -1 and axis not in output_dimensions:
raise ValueError(
"{}{}{}".format(
"Unexpected channels axis {}. ".format(axis),
"Expected to be -1 or one of the axes of `output`, ",
"which has {} dimensions.".format(len(int_shape(output)))))
// If the channels are not in the last axis, move them to be there:
if axis != -1 and axis != output_dimensions[-1]:
permutation = output_dimensions[:axis]
permutation += output_dimensions[axis + 1:] + [axis]
output = permute_dimensions(output, permutation)
target = permute_dimensions(target, permutation)
if from_logits:
output = T.nnet.softmax(output)
else:
// scale preds so that the class probas of each sample sum to 1
output /= output.sum(axis=-1, keepdims=True)
// avoid numerical instability with _EPSILON clipping
output = T.clip(output, epsilon(), 1.0 - epsilon())
return T.nnet.categorical_crossentropy(output, target)
def sparse_categorical_crossentropy(target, output, from_logits=False, axis=-1):
output_dimensions = list(range(len(int_shape(output))))
if axis != -1 and axis not in output_dimensions:
raise ValueError(
"{}{}{}".format(
"Unexpected channels axis {}. ".format(axis),
"Expected to be -1 or one of the axes of `output`, ",
"which has {} dimensions.".format(len(int_shape(output)))))
// If the channels are not in the last axis, move them to be there:
if axis != -1 and axis != output_dimensions[-1]:
permutation = output_dimensions[:axis]
permutation += output_dimensions[axis + 1:] + [axis]
output = permute_dimensions(output, permutation)
target = permute_dimensions(target, permutation)
target = T.cast(T.flatten(target), "int32")
target = T.extra_ops.to_one_hot(target, nb_class=output.shape[-1])
target = reshape(target, shape(output))
return categorical_crossentropy(target, output, from_logits, axis=-1)
def binary_crossentropy(target, output, from_logits=False):
if from_logits:
output = T.nnet.sigmoid(output)
// avoid numerical instability with _EPSILON clipping
output = T.clip(output, epsilon(), 1.0 - epsilon())
return T.nnet.binary_crossentropy(output, target)
def sigmoid(x):
return T.nnet.sigmoid(x)
def hard_sigmoid(x):
return T.nnet.hard_sigmoid(x)
def tanh(x):
return T.tanh(x)
def dropout(x, level, noise_shape=None, seed=None):
Sets entries in `x` to zero at random,
while scaling the entire tensor.
// Arguments
x: tensor
level: fraction of the entries in the tensor
that will be set to 0.
noise_shape: shape for randomly generated keep/drop flags,
must be broadcastable to the shape of `x`
seed: random seed to ensure determinism.
if level < 0. or level >= 1:
raise ValueError("Dropout level must be in interval [0, 1[.")
if seed is None:
seed = np.random.randint(1, 10e6)
if isinstance(noise_shape, list):
noise_shape = tuple(noise_shape)
rng = RandomStreams(seed=seed)
retain_prob = 1. - level
if noise_shape is None:
random_tensor = rng.binomial(x.shape, p=retain_prob, dtype=x.dtype)
else:
random_tensor = rng.binomial(noise_shape, p=retain_prob, dtype=x.dtype)
random_tensor = T.patternbroadcast(random_tensor,
[dim == 1 for dim in noise_shape])
x *= random_tensor
x /= retain_prob
return x
def l2_normalize(x, axis=None):
square_sum = T.sum(T.square(x), axis=axis, keepdims=True)
norm = T.sqrt(T.maximum(square_sum, epsilon()))
return x / norm
def in_top_k(predictions, targets, k):
Returns whether the `targets` are in the top `k` `predictions`.
// Arguments
predictions: A tensor of shape `(batch_size, classes)` and type `float32`.
targets: A 1D tensor of length `batch_size` and type `int32` or `int64`.
k: An `int`, number of top elements to consider.
// Returns
A 1D tensor of length `batch_size` and type `bool`.
`output[i]` is `True` if `predictions[i, targets[i]]` is within top-`k`
values of `predictions[i]`.
// handle k < 1 and k >= predictions.shape[1] cases to match TF behavior
if k < 1:
// dtype="bool" is only available since Theano 0.9.0
try:
return T.zeros_like(targets, dtype="bool")
except TypeError:
return T.zeros_like(targets, dtype="int8")
if k >= int_shape(predictions)[1]:
try:
return T.ones_like(targets, dtype="bool")
except TypeError:
return T.ones_like(targets, dtype="int8")
predictions_k = T.sort(predictions)[:, -k]
targets_values = predictions[T.arange(targets.shape[0]), targets]
return T.ge(targets_values, predictions_k)
// CONVOLUTIONS
def _preprocess_conv2d_input(x, data_format):
if data_format == "channels_last":
// TF uses the last dimension as channel dimension,
// instead of the 2nd one.
// TH input shape: (samples, input_depth, rows, cols)
// TF input shape: (samples, rows, cols, input_depth)
x = x.dimshuffle((0, 3, 1, 2))
return x
def _preprocess_conv3d_input(x, data_format):
if data_format == "channels_last":
// TF uses the last dimension as channel dimension,
// instead of the 2nd one.
// TH input shape: (samples, input_depth, rows, cols, slices)
// TF input shape: (samples, rows, cols, slices, input_depth)
x = x.dimshuffle((0, 4, 1, 2, 3))
return x
def _preprocess_conv2d_kernel(kernel, data_format):
// As of Keras 2.0.0, all kernels are normalized
// on the format `(rows, cols, input_depth, depth)`,
// independently of `data_format`.
// Theano expects `(depth, input_depth, rows, cols)`.
kernel = kernel.dimshuffle((3, 2, 0, 1))
return kernel
def _preprocess_conv2d_depthwise_kernel(kernel, kernel_shape, data_format):
// As of Keras 2.0.0, all kernels are normalized
// on the format `(rows, cols, input_depth, depth)`,
// independently of `data_format`.
// Theano expects `(input_depth * depth, 1, rows, cols)`
// for depthwise convolution.
kernel = kernel[::-1, ::-1, :, :]
kernel = kernel.dimshuffle((2, 3, 0, 1))
kernel = reshape(kernel, kernel_shape)
return kernel
def _preprocess_conv3d_kernel(kernel, data_format):
// As of Keras 2.0.0, all kernels are normalized
// on the format `(space, input_depth, depth)`,
// independently of `data_format`.
// Theano expects `(depth, input_depth, space)`.
kernel = kernel.dimshuffle((4, 3, 0, 1, 2))
return kernel
def _preprocess_padding(padding):
if padding == "same":
th_padding = "half"
elif padding == "valid":
th_padding = "valid"
elif padding == "full":
th_padding = "full"
else:
raise ValueError("Border mode not supported:", str(padding))
return th_padding
def _preprocess_conv2d_image_shape(image_shape, data_format):
// Theano might not accept long type
def int_or_none(value):
try:
return int(value)
except TypeError:
return None
if data_format == "channels_last":
if image_shape:
image_shape = transpose_shape(image_shape, "channels_first",
spatial_axes=(1, 2))
if image_shape is not None:
image_shape = tuple(int_or_none(v) for v in image_shape)
return image_shape
def _preprocess_conv3d_volume_shape(volume_shape, data_format):
// Theano might not accept long type
def int_or_none(value):
try:
return int(value)
except TypeError:
return None
if data_format == "channels_last":
if volume_shape:
volume_shape = (volume_shape[0], volume_shape[4],
volume_shape[1], volume_shape[2], volume_shape[3])
if volume_shape is not None:
volume_shape = tuple(int_or_none(v) for v in volume_shape)
return volume_shape
def _preprocess_conv2d_filter_shape(filter_shape, data_format):
// Theano might not accept long type
def int_or_none(value):
try:
return int(value)
except TypeError:
return None
if filter_shape:
filter_shape = (filter_shape[3], filter_shape[2],
filter_shape[0], filter_shape[1])
if filter_shape is not None:
filter_shape = tuple(int_or_none(v) for v in filter_shape)
return filter_shape
def _preprocess_conv2d_depthwise_filter_shape(filter_shape, data_format):
// Theano might not accept long type
def int_or_none(value):
try:
return int(value)
except TypeError:
return None
if filter_shape:
filter_shape = (filter_shape[3] * filter_shape[2], 1,
filter_shape[0], filter_shape[1])
if filter_shape is not None:
filter_shape = tuple(int_or_none(v) for v in filter_shape)
return filter_shape
def _preprocess_conv3d_filter_shape(filter_shape, data_format):
// Theano might not accept long type
def int_or_none(value):
try:
return int(value)
except TypeError:
return None
if filter_shape:
filter_shape = (filter_shape[4], filter_shape[3],
filter_shape[0], filter_shape[1], filter_shape[2])
if filter_shape is not None:
filter_shape = tuple(int_or_none(v) for v in filter_shape)
return filter_shape
def _postprocess_conv2d_output(conv_out, x,
padding, kernel_shape,
strides, data_format):
if padding == "same":
if kernel_shape[2] % 2 == 0:
i = (x.shape[2] + strides[0] - 1) // strides[0]
conv_out = conv_out[:, :, :i, :]
if kernel_shape[3] % 2 == 0:
i = (x.shape[3] + strides[1] - 1) // strides[1]
conv_out = conv_out[:, :, :, :i]
if data_format == "channels_last":
conv_out = conv_out.dimshuffle((0, 2, 3, 1))
return conv_out
def _postprocess_conv3d_output(conv_out, x,
padding, kernel_shape,
strides, data_format):
if padding == "same":
if kernel_shape[2] % 2 == 0:
i = (x.shape[2] + strides[0] - 1) // strides[0]
conv_out = conv_out[:, :, :i, :, :]
if kernel_shape[3] % 2 == 0:
i = (x.shape[3] + strides[1] - 1) // strides[1]
conv_out = conv_out[:, :, :, :i, :]
if kernel_shape[4] % 2 == 0:
i = (x.shape[4] + strides[2] - 1) // strides[2]
conv_out = conv_out[:, :, :, :, :i]
if data_format == "channels_last":
conv_out = conv_out.dimshuffle((0, 2, 3, 4, 1))
return conv_out
def conv1d(x, kernel, strides=1, padding="valid",
data_format=None, dilation_rate=1):
1D convolution.
// Arguments
kernel: kernel tensor.
strides: stride integer.
padding: string, `"same"`, `"causal"` or `"valid"`.
data_format: string, one of "channels_last", "channels_first"
dilation_rate: integer.
data_format = normalize_data_format(data_format)
kernel_shape = int_shape(kernel)
if padding == "causal":
// causal (dilated) convolution:
if not kernel_shape:
raise AttributeError("Causal padding requires kernel._keras_shape set.")
left_pad = dilation_rate * (kernel_shape[0] - 1)
x = temporal_padding(x, (left_pad, 0))
padding = "valid"
shape = int_shape(x)
if data_format == "channels_last":
// original shape: (batch, length, input_dim)
// add dim to x to have (batch, length, 1, input_dim)
x = expand_dims(x, 2)
// update x._keras_shape
if shape is not None:
x._keras_shape = (shape[0], shape[1], 1, shape[2])
else:
// original shape: (batch, input_dim, length)
// add dim to x to have (batch, input_dim, length, 1)
x = expand_dims(x, 3)
// update x._keras_shape
if shape is not None:
x._keras_shape = (shape[0], shape[1], shape[2], 1)
// update dilation rate, strides
dilation_rate = (dilation_rate, 1)
strides = (strides, 1)
// add dim to kernel (always same format independently of data_format)
// i.e. (rows, 1, input_depth, depth)
kernel = expand_dims(kernel, 1)
output = conv2d(x, kernel,
strides=strides, padding=padding,
data_format=data_format, dilation_rate=dilation_rate)
// remove added dim
if data_format == "channels_last":
output = squeeze(output, 2)
else:
output = squeeze(output, 3)
return output
def conv2d(x, kernel, strides=(1, 1), padding="valid",
data_format=None, dilation_rate=(1, 1)):
2D convolution.
// Arguments
kernel: kernel tensor.
strides: strides tuple.
padding: string, "same" or "valid".
data_format: "channels_last" or "channels_first".
Whether to use Theano or TensorFlow data format
in inputs/kernels/outputs.
data_format = normalize_data_format(data_format)
image_shape = _preprocess_conv2d_image_shape(int_shape(x), data_format)
kernel_shape = int_shape(kernel)
if kernel_shape is None:
kernel_shape = kernel.eval().shape // in case of a shared variable
kernel_shape = _preprocess_conv2d_filter_shape(kernel_shape, data_format)
x = _preprocess_conv2d_input(x, data_format)
kernel = _preprocess_conv2d_kernel(kernel, data_format)
th_padding = _preprocess_padding(padding)
conv_out = T.nnet.conv2d(x, kernel,
border_mode=th_padding,
subsample=strides,
input_shape=image_shape,
filter_shape=kernel_shape,
filter_dilation=dilation_rate)
conv_out = _postprocess_conv2d_output(conv_out, x, padding,
kernel_shape, strides, data_format)
return conv_out
def conv2d_transpose(x, kernel, output_shape, strides=(1, 1),
padding="valid", data_format=None, dilation_rate=(1, 1)):
2D deconvolution (transposed convolution).
// Arguments
kernel: kernel tensor.
output_shape: desired dimensions of output.
strides: strides tuple.
padding: string, "same" or "valid".
data_format: "channels_last" or "channels_first".
Whether to use Theano or TensorFlow data format
in inputs/kernels/outputs.
dilation_rate: tuple of 2 integers.
// Raises
ValueError: if using an even kernel size with padding "same".
flip_filters = False
data_format = normalize_data_format(data_format)
if data_format == "channels_last":
output_shape = (output_shape[0],
output_shape[3],
output_shape[1],
output_shape[2])
kernel_shape = int_shape(kernel)
if kernel_shape is None:
kernel_shape = kernel.eval().shape // in case of a shared variable
if padding == "same" and kernel_shape[0] % 2 == 0:
raise ValueError("In `Conv2DTranspose`, with padding mode `same`, "
"even kernel sizes are not supported with Theano. "
"You can set `kernel_size` to an odd number.")
kernel_shape = _preprocess_conv2d_filter_shape(kernel_shape, data_format)
x = _preprocess_conv2d_input(x, data_format)
kernel = _preprocess_conv2d_kernel(kernel, data_format)
th_padding = _preprocess_padding(padding)
op = T.nnet.abstract_conv.AbstractConv2d_gradInputs(
imshp=None,
kshp=kernel_shape,
subsample=strides,
border_mode=th_padding,
filter_flip=not flip_filters,
filter_dilation=dilation_rate)
conv_out = op(kernel, x, output_shape[2:])
conv_out = _postprocess_conv2d_output(conv_out, x, padding,
kernel_shape, strides, data_format)
return conv_out
def separable_conv1d(x, depthwise_kernel, pointwise_kernel, strides=1,
padding="valid", data_format=None, dilation_rate=1):
1D convolution with separable filters.
// Arguments
x: input tensor
depthwise_kernel: convolution kernel for the depthwise convolution.
pointwise_kernel: kernel for the 1x1 convolution.
strides: strides integer.
padding: string, `"same"` or `"valid"`.
data_format: string, `"channels_last"` or `"channels_first"`.
dilation_rate: integer dilation rate.
// Returns
Output tensor.
// Raises
ValueError: if `data_format` is neither `"channels_last"` or
`"channels_first"`.
data_format = normalize_data_format(data_format)
if isinstance(strides, int):
strides = (strides,)
if isinstance(dilation_rate, int):
dilation_rate = (dilation_rate,)
if data_format == "channels_last":
spatial_start_dim = 2
else:
spatial_start_dim = 3
x = expand_dims(x, spatial_start_dim)
depthwise_kernel = expand_dims(depthwise_kernel, 1)
pointwise_kernel = expand_dims(pointwise_kernel, 1)
strides = strides + (1,)
dilation_rate = dilation_rate + (1,)
image_shape = _preprocess_conv2d_image_shape(int_shape(x), data_format)
depthwise_kernel_shape = int_shape(depthwise_kernel)
if depthwise_kernel_shape is None:
// in case of a shared variable
depthwise_kernel_shape = depthwise_kernel.eval().shape
depthwise_kernel_shape = _preprocess_conv2d_depthwise_filter_shape(
depthwise_kernel_shape, data_format)
pointwise_kernel_shape = int_shape(pointwise_kernel)
if pointwise_kernel_shape is None:
// in case of a shared variable
pointwise_kernel_shape = pointwise_kernel.eval().shape
pointwise_kernel_shape = _preprocess_conv2d_filter_shape(
pointwise_kernel_shape, data_format)
x = _preprocess_conv2d_input(x, data_format)
depthwise_kernel = _preprocess_conv2d_depthwise_kernel(
depthwise_kernel, depthwise_kernel_shape, data_format)
pointwise_kernel = _preprocess_conv2d_kernel(pointwise_kernel, data_format)
th_padding = _preprocess_padding(padding)
conv_out = T.nnet.conv2d(x, depthwise_kernel,
border_mode=th_padding,
subsample=strides,
input_shape=image_shape,
filter_shape=depthwise_kernel_shape,
filter_dilation=dilation_rate,
num_groups=image_shape[1])
conv_out = T.nnet.conv2d(conv_out, pointwise_kernel,
border_mode=th_padding,
subsample=(1, 1),
input_shape=None,
filter_shape=pointwise_kernel_shape,
filter_dilation=dilation_rate)
conv_out = _postprocess_conv2d_output(conv_out, x, padding,
pointwise_kernel_shape,
strides, data_format)
conv_out = squeeze(conv_out, spatial_start_dim)
return conv_out
def separable_conv2d(x, depthwise_kernel, pointwise_kernel, strides=(1, 1),
padding="valid", data_format=None, dilation_rate=(1, 1)):
2D convolution with separable filters.
// Arguments
x: input tensor
depthwise_kernel: convolution kernel for the depthwise convolution.
pointwise_kernel: kernel for the 1x1 convolution.
strides: strides tuple (length 2).
padding: string, `"same"` or `"valid"`.
data_format: string, `"channels_last"` or `"channels_first"`.
dilation_rate: tuple of integers,
dilation rates for the separable convolution.
// Returns
Output tensor.
// Raises
ValueError: if `data_format` is neither `"channels_last"` or
`"channels_first"`.
data_format = normalize_data_format(data_format)
image_shape = _preprocess_conv2d_image_shape(int_shape(x), data_format)
depthwise_kernel_shape = int_shape(depthwise_kernel)
if depthwise_kernel_shape is None:
// in case of a shared variable
depthwise_kernel_shape = depthwise_kernel.eval().shape
depthwise_kernel_shape = _preprocess_conv2d_depthwise_filter_shape(
depthwise_kernel_shape, data_format)
pointwise_kernel_shape = int_shape(pointwise_kernel)
if pointwise_kernel_shape is None:
// in case of a shared variable
pointwise_kernel_shape = pointwise_kernel.eval().shape
pointwise_kernel_shape = _preprocess_conv2d_filter_shape(
pointwise_kernel_shape, data_format)
x = _preprocess_conv2d_input(x, data_format)
depthwise_kernel = _preprocess_conv2d_depthwise_kernel(
depthwise_kernel, depthwise_kernel_shape, data_format)
pointwise_kernel = _preprocess_conv2d_kernel(pointwise_kernel, data_format)
th_padding = _preprocess_padding(padding)
conv_out = T.nnet.conv2d(x, depthwise_kernel,
border_mode=th_padding,
subsample=strides,
input_shape=image_shape,
filter_shape=depthwise_kernel_shape,
filter_dilation=dilation_rate,
num_groups=image_shape[1])
conv_out = T.nnet.conv2d(conv_out, pointwise_kernel,
border_mode=th_padding,
subsample=(1, 1),
input_shape=None,
filter_shape=pointwise_kernel_shape,
filter_dilation=dilation_rate)
conv_out = _postprocess_conv2d_output(conv_out, x, padding,
pointwise_kernel_shape,
strides, data_format)
return conv_out
def depthwise_conv2d(x, depthwise_kernel, strides=(1, 1), padding="valid",
data_format=None, dilation_rate=(1, 1)):
2D convolution with separable filters.
// Arguments
x: input tensor
depthwise_kernel: convolution kernel for the depthwise convolution.
strides: strides tuple (length 2).
padding: string, `"same"` or `"valid"`.
data_format: string, `"channels_last"` or `"channels_first"`.
dilation_rate: tuple of integers,
dilation rates for the separable convolution.
// Returns
Output tensor.
// Raises
ValueError: if `data_format` is neither `"channels_last"` or
`"channels_first"`.
data_format = normalize_data_format(data_format)
image_shape = _preprocess_conv2d_image_shape(int_shape(x), data_format)
depthwise_kernel_shape = int_shape(depthwise_kernel)
if depthwise_kernel_shape is None:
// in case of a shared variable
depthwise_kernel_shape = depthwise_kernel.eval().shape
depthwise_kernel_shape = _preprocess_conv2d_depthwise_filter_shape(
depthwise_kernel_shape, data_format)
x = _preprocess_conv2d_input(x, data_format)
depthwise_kernel = _preprocess_conv2d_depthwise_kernel(
depthwise_kernel, depthwise_kernel_shape, data_format)
th_padding = _preprocess_padding(padding)
conv_out = T.nnet.conv2d(x, depthwise_kernel,
border_mode=th_padding,
subsample=strides,
input_shape=image_shape,
filter_shape=depthwise_kernel_shape,
filter_dilation=dilation_rate,
num_groups=image_shape[1])
conv_out = _postprocess_conv2d_output(
conv_out, x, padding, depthwise_kernel_shape, strides, data_format)
return conv_out
def conv3d(x, kernel, strides=(1, 1, 1),
padding="valid", data_format=None,
dilation_rate=(1, 1, 1)):
3D convolution.
// Arguments
kernel: kernel tensor.
strides: strides tuple.
padding: string, "same" or "valid".
data_format: "channels_last" or "channels_first".
Whether to use Theano or TensorFlow data format
in inputs/kernels/outputs.
data_format = normalize_data_format(data_format)
volume_shape = _preprocess_conv3d_volume_shape(int_shape(x), data_format)
kernel_shape = int_shape(kernel)
if kernel_shape is None:
kernel_shape = kernel.eval().shape // in case of a shared variable
kernel_shape = _preprocess_conv3d_filter_shape(kernel_shape, data_format)
x = _preprocess_conv3d_input(x, data_format)
kernel = _preprocess_conv3d_kernel(kernel, data_format)
th_padding = _preprocess_padding(padding)
conv_out = T.nnet.conv3d(x, kernel,
border_mode=th_padding,
subsample=strides,
input_shape=volume_shape,
filter_shape=kernel_shape,
filter_dilation=dilation_rate)
conv_out = _postprocess_conv3d_output(conv_out, x, padding,
kernel_shape, strides, data_format)


|
XLMulator: Excel XLM Macro Emulator
|
Functions | |
| def | _concat (params, sheet) |
| def | _plus (params, sheet) |
| def | _minus (params, sheet) |
| def | _less_than (params, sheet) |
| def | _not_equal (params, sheet) |
| def | _times (params, sheet) |
| def | _equals (params, sheet) |
| def | _greater_than (params, sheet) |
| def | _divide (params, sheet) |
| def | _unsigned_minus (params, sheet) |
| def | _unsigned_plus (params, sheet) |
| def | _greater_or_equal (params, sheet) |
| def | CHAR (params, sheet) |
| def | RUN (params, sheet) |
| def | CONCATENATE (params, sheet) |
| def | CALL (params, sheet) |
| def | EXEC (params, sheet) |
| def | HALT (params, sheet) |
| def | FORMULA (params, sheet) |
| def | WORKBOOK_HIDE (params, sheet) |
| def | GOTO (params, sheet) |
| def | GET_WORKSPACE (params, sheet) |
| def | NOW (params, sheet) |
| def | WAIT (params, sheet) |
| def | FOPEN (params, sheet) |
| def | OPEN (params, sheet) |
| def | FPOS (params, sheet) |
| def | FREAD (params, sheet) |
| def | FCLOSE (params, sheet) |
| def | FILE_CLOSE (params, sheet) |
| def | FILE_DELETE (params, sheet) |
| def | IF (params, sheet) |
| def | END_IF (params, sheet) |
| def | CLOSE (params, sheet) |
| def | SEARCH (params, sheet) |
| def | ISNUMBER (params, sheet) |
| def | ALERT (params, sheet) |
| def | ALIGNMENT (params, sheet) |
| def | ERROR (params, sheet) |
| def | BORDER (params, sheet) |
| def | WORKBOOK_SELECT (params, sheet) |
| def | PATTERNS (params, sheet) |
| def | WINDOW_RESTORE (params, sheet) |
| def | FORMAT_FONT (params, sheet) |
| def | WINDOW_SIZE (params, sheet) |
| def | RETURN (params, sheet) |
| def | EDIT_COLOR (params, sheet) |
| def | DELETE_NAME (params, sheet) |
| def | SELECT (params, sheet) |
| def | COLUMN_WIDTH (params, sheet) |
| def | ROW_HEIGHT (params, sheet) |
| def | WINDOW_MAXIMIZE (params, sheet) |
| def | FORMAT_NUMBER (params, sheet) |
| def | OFFSET (params, sheet) |
| def | WORKBOOK_UNHIDE (params, sheet) |
| def | FILL_AUTO (params, sheet) |
| def | SET_NAME (params, sheet) |
| def | ERROR_TYPE (params, sheet) |
| def | DOCUMENTS (params, sheet) |
| def | MATCH (params, sheet) |
| def | GET_CELL (params, sheet) |
| def | DAY (params, sheet) |
| def | APP_MAXIMIZE (params, sheet) |
| def | RANDBETWEEN (params, sheet) |
| def | ISERROR (params, sheet) |
| def | CLEAR (params, sheet) |
| def | ON_TIME (params, sheet) |
| def | User_Defined_Function (params, sheet) |
| def | LOWER (params, sheet) |
| def | SUMIF (params, sheet) |
| def | SUM (params, sheet) |
| def | SEND_KEYS (params, sheet) |
| def | APP_ACTIVATE (params, sheet) |
| def | FWRITELN (params, sheet) |
| def | FILES (params, sheet) |
| def | WHILE (params, sheet) |
| def | NEXT (params, sheet) |
| def | COPY (params, sheet) |
| def | PASTE_SPECIAL (params, sheet) |
| def | CANCEL_COPY (params, sheet) |
| def | INDEX (params, sheet) |
| def | SET_VALUE (params, sheet) |
| def | ON_SHEET (params, sheet) |
| def | GET_DOCUMENT (params, sheet) |
| def | NEW (params, sheet) |
| def | WORKBOOK_INSERT (params, sheet) |
| def | ACTIVATE_PREV (params, sheet) |
| def | WORKBOOK_COPY (params, sheet) |
| def | WORKBOOK_NAME (params, sheet) |
| def | PROTECT_DOCUMENT (params, sheet) |
| def | WORKBOOK_PREV (params, sheet) |
| def | SAVE_AS (params, sheet) |
| def | APP_TITLE (params, sheet) |
| def | MESSAGE (params, sheet) |
| def | FORMULA_FILL (params, sheet) |
| def | FOR_CELL (params, sheet) |
| def | VBA_INSERT_FILE (params, sheet) |
| def | OR (params, sheet) |
| def | NOT (params, sheet) |
| def | GET_WORKBOOK (params, sheet) |
| def | REGISTER_ID (params, sheet) |
| def | ACTIVATE (params, sheet) |
| def | ARGUMENT (params, sheet) |
| def | ACTIVE_CELL (params, sheet) |
| def | LEN (params, sheet) |
| def | ELSE (params, sheet) |
| def | COUNTA (params, sheet) |
| def | MID (params, sheet) |
| def | CODE (params, sheet) |
| def | GET_WINDOW (params, sheet) |
| def | should_emulate_cell (cell) |
| Check to see if a given XLM cell runs something that we want to track in the actions. More... | |
| def | _is_interesting_cell (cell) |
| See if a cell value looks interesting. More... | |
| def | eval (func_name, params, sheet) |
| Emulate the behavior of a given XLM function. More... | |
Variables | |
| bool | debug = False |
| list | funcs_of_interest = [] |
| Function emulators. More... | |
| dictionary | func_lookup = {} |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
See if a cell value looks interesting.
| cell | (XLM_Object) The cell to check. |
Definition at line 712 of file xlm_library.py.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
| def XLM.xlm_library.ACTIVATE | ( | params, | |
| sheet | |||
| ) |
Definition at line 629 of file xlm_library.py.
| def XLM.xlm_library.ACTIVATE_PREV | ( | params, | |
| sheet | |||
| ) |
Definition at line 546 of file xlm_library.py.
| def XLM.xlm_library.ACTIVE_CELL | ( | params, | |
| sheet | |||
| ) |
Definition at line 639 of file xlm_library.py.
| def XLM.xlm_library.ALERT | ( | params, | |
| sheet | |||
| ) |
Definition at line 236 of file xlm_library.py.
| def XLM.xlm_library.ALIGNMENT | ( | params, | |
| sheet | |||
| ) |
Definition at line 241 of file xlm_library.py.
| def XLM.xlm_library.APP_ACTIVATE | ( | params, | |
| sheet | |||
| ) |
Definition at line 474 of file xlm_library.py.
| def XLM.xlm_library.APP_MAXIMIZE | ( | params, | |
| sheet | |||
| ) |
Definition at line 420 of file xlm_library.py.
| def XLM.xlm_library.APP_TITLE | ( | params, | |
| sheet | |||
| ) |
Definition at line 576 of file xlm_library.py.
| def XLM.xlm_library.ARGUMENT | ( | params, | |
| sheet | |||
| ) |
Definition at line 634 of file xlm_library.py.
| def XLM.xlm_library.BORDER | ( | params, | |
| sheet | |||
| ) |
Definition at line 253 of file xlm_library.py.
| def XLM.xlm_library.CALL | ( | params, | |
| sheet | |||
| ) |
Definition at line 129 of file xlm_library.py.
| def XLM.xlm_library.CANCEL_COPY | ( | params, | |
| sheet | |||
| ) |
Definition at line 509 of file xlm_library.py.
| def XLM.xlm_library.CHAR | ( | params, | |
| sheet | |||
| ) |
| def XLM.xlm_library.CLEAR | ( | params, | |
| sheet | |||
| ) |
Definition at line 437 of file xlm_library.py.
| def XLM.xlm_library.CLOSE | ( | params, | |
| sheet | |||
| ) |
Definition at line 218 of file xlm_library.py.
| def XLM.xlm_library.CODE | ( | params, | |
| sheet | |||
| ) |
Definition at line 671 of file xlm_library.py.
| def XLM.xlm_library.COLUMN_WIDTH | ( | params, | |
| sheet | |||
| ) |
Definition at line 313 of file xlm_library.py.
| def XLM.xlm_library.CONCATENATE | ( | params, | |
| sheet | |||
| ) |
| def XLM.xlm_library.COPY | ( | params, | |
| sheet | |||
| ) |
Definition at line 499 of file xlm_library.py.
| def XLM.xlm_library.COUNTA | ( | params, | |
| sheet | |||
| ) |
Definition at line 653 of file xlm_library.py.
| def XLM.xlm_library.DAY | ( | params, | |
| sheet | |||
| ) |
Definition at line 415 of file xlm_library.py.
| def XLM.xlm_library.DELETE_NAME | ( | params, | |
| sheet | |||
| ) |
Definition at line 301 of file xlm_library.py.
| def XLM.xlm_library.DOCUMENTS | ( | params, | |
| sheet | |||
| ) |
Definition at line 365 of file xlm_library.py.
| def XLM.xlm_library.EDIT_COLOR | ( | params, | |
| sheet | |||
| ) |
Definition at line 295 of file xlm_library.py.
| def XLM.xlm_library.ELSE | ( | params, | |
| sheet | |||
| ) |
Definition at line 648 of file xlm_library.py.
| def XLM.xlm_library.END_IF | ( | params, | |
| sheet | |||
| ) |
Definition at line 213 of file xlm_library.py.
| def XLM.xlm_library.ERROR | ( | params, | |
| sheet | |||
| ) |
Definition at line 247 of file xlm_library.py.
| def XLM.xlm_library.ERROR_TYPE | ( | params, | |
| sheet | |||
| ) |
Definition at line 361 of file xlm_library.py.
| def XLM.xlm_library.eval | ( | func_name, | |
| params, | |||
| sheet | |||
| ) |
Emulate the behavior of a given XLM function.
| func_name | (str) The name of the function. |
| params | (list) The mostly resolved parameters to pass to the function. |
| sheet | (ExcelSheet) The sheet containing the paramaters to fully resolve. |
Definition at line 726 of file xlm_library.py.
| def XLM.xlm_library.EXEC | ( | params, | |
| sheet | |||
| ) |
Definition at line 135 of file xlm_library.py.
| def XLM.xlm_library.FCLOSE | ( | params, | |
| sheet | |||
| ) |
| def XLM.xlm_library.FILE_CLOSE | ( | params, | |
| sheet | |||
| ) |
| def XLM.xlm_library.FILE_DELETE | ( | params, | |
| sheet | |||
| ) |
Definition at line 203 of file xlm_library.py.
| def XLM.xlm_library.FILES | ( | params, | |
| sheet | |||
| ) |
Definition at line 484 of file xlm_library.py.
| def XLM.xlm_library.FILL_AUTO | ( | params, | |
| sheet | |||
| ) |
Definition at line 349 of file xlm_library.py.
| def XLM.xlm_library.FOPEN | ( | params, | |
| sheet | |||
| ) |
| def XLM.xlm_library.FOR_CELL | ( | params, | |
| sheet | |||
| ) |
Definition at line 594 of file xlm_library.py.
| def XLM.xlm_library.FORMAT_FONT | ( | params, | |
| sheet | |||
| ) |
Definition at line 277 of file xlm_library.py.
| def XLM.xlm_library.FORMAT_NUMBER | ( | params, | |
| sheet | |||
| ) |
Definition at line 331 of file xlm_library.py.
| def XLM.xlm_library.FORMULA | ( | params, | |
| sheet | |||
| ) |
Definition at line 147 of file xlm_library.py.
| def XLM.xlm_library.FORMULA_FILL | ( | params, | |
| sheet | |||
| ) |
Definition at line 586 of file xlm_library.py.
| def XLM.xlm_library.FPOS | ( | params, | |
| sheet | |||
| ) |
Definition at line 184 of file xlm_library.py.
| def XLM.xlm_library.FREAD | ( | params, | |
| sheet | |||
| ) |
Definition at line 189 of file xlm_library.py.
| def XLM.xlm_library.FWRITELN | ( | params, | |
| sheet | |||
| ) |
Definition at line 479 of file xlm_library.py.
| def XLM.xlm_library.GET_CELL | ( | params, | |
| sheet | |||
| ) |
| def XLM.xlm_library.GET_DOCUMENT | ( | params, | |
| sheet | |||
| ) |
Definition at line 531 of file xlm_library.py.
| def XLM.xlm_library.GET_WINDOW | ( | params, | |
| sheet | |||
| ) |
Definition at line 676 of file xlm_library.py.
| def XLM.xlm_library.GET_WORKBOOK | ( | params, | |
| sheet | |||
| ) |
Definition at line 619 of file xlm_library.py.
| def XLM.xlm_library.GET_WORKSPACE | ( | params, | |
| sheet | |||
| ) |
Definition at line 162 of file xlm_library.py.
| def XLM.xlm_library.GOTO | ( | params, | |
| sheet | |||
| ) |
Definition at line 157 of file xlm_library.py.
| def XLM.xlm_library.HALT | ( | params, | |
| sheet | |||
| ) |
Definition at line 141 of file xlm_library.py.
| def XLM.xlm_library.IF | ( | params, | |
| sheet | |||
| ) |
Definition at line 208 of file xlm_library.py.
| def XLM.xlm_library.INDEX | ( | params, | |
| sheet | |||
| ) |
Definition at line 514 of file xlm_library.py.
| def XLM.xlm_library.ISERROR | ( | params, | |
| sheet | |||
| ) |
Definition at line 432 of file xlm_library.py.
| def XLM.xlm_library.ISNUMBER | ( | params, | |
| sheet | |||
| ) |
Definition at line 230 of file xlm_library.py.
| def XLM.xlm_library.LEN | ( | params, | |
| sheet | |||
| ) |
Definition at line 644 of file xlm_library.py.
| def XLM.xlm_library.LOWER | ( | params, | |
| sheet | |||
| ) |
Definition at line 455 of file xlm_library.py.
| def XLM.xlm_library.MATCH | ( | params, | |
| sheet | |||
| ) |
Definition at line 369 of file xlm_library.py.
| def XLM.xlm_library.MESSAGE | ( | params, | |
| sheet | |||
| ) |
Definition at line 581 of file xlm_library.py.
| def XLM.xlm_library.MID | ( | params, | |
| sheet | |||
| ) |
| def XLM.xlm_library.NEW | ( | params, | |
| sheet | |||
| ) |
Definition at line 536 of file xlm_library.py.
| def XLM.xlm_library.NEXT | ( | params, | |
| sheet | |||
| ) |
Definition at line 494 of file xlm_library.py.
| def XLM.xlm_library.NOT | ( | params, | |
| sheet | |||
| ) |
| def XLM.xlm_library.NOW | ( | params, | |
| sheet | |||
| ) |
Definition at line 166 of file xlm_library.py.
| def XLM.xlm_library.OFFSET | ( | params, | |
| sheet | |||
| ) |
Definition at line 337 of file xlm_library.py.
| def XLM.xlm_library.ON_SHEET | ( | params, | |
| sheet | |||
| ) |
Definition at line 526 of file xlm_library.py.
| def XLM.xlm_library.ON_TIME | ( | params, | |
| sheet | |||
| ) |
Definition at line 443 of file xlm_library.py.
| def XLM.xlm_library.OPEN | ( | params, | |
| sheet | |||
| ) |
| def XLM.xlm_library.OR | ( | params, | |
| sheet | |||
| ) |
Definition at line 604 of file xlm_library.py.
| def XLM.xlm_library.PASTE_SPECIAL | ( | params, | |
| sheet | |||
| ) |
Definition at line 504 of file xlm_library.py.
| def XLM.xlm_library.PATTERNS | ( | params, | |
| sheet | |||
| ) |
Definition at line 265 of file xlm_library.py.
| def XLM.xlm_library.PROTECT_DOCUMENT | ( | params, | |
| sheet | |||
| ) |
Definition at line 561 of file xlm_library.py.
| def XLM.xlm_library.RANDBETWEEN | ( | params, | |
| sheet | |||
| ) |
| def XLM.xlm_library.REGISTER_ID | ( | params, | |
| sheet | |||
| ) |
Definition at line 624 of file xlm_library.py.
| def XLM.xlm_library.RETURN | ( | params, | |
| sheet | |||
| ) |
Definition at line 289 of file xlm_library.py.
| def XLM.xlm_library.ROW_HEIGHT | ( | params, | |
| sheet | |||
| ) |
Definition at line 319 of file xlm_library.py.
| def XLM.xlm_library.RUN | ( | params, | |
| sheet | |||
| ) |
Definition at line 120 of file xlm_library.py.
| def XLM.xlm_library.SAVE_AS | ( | params, | |
| sheet | |||
| ) |
Definition at line 571 of file xlm_library.py.
| def XLM.xlm_library.SEARCH | ( | params, | |
| sheet | |||
| ) |
Definition at line 224 of file xlm_library.py.
| def XLM.xlm_library.SELECT | ( | params, | |
| sheet | |||
| ) |
Definition at line 307 of file xlm_library.py.
| def XLM.xlm_library.SEND_KEYS | ( | params, | |
| sheet | |||
| ) |
Definition at line 469 of file xlm_library.py.
| def XLM.xlm_library.SET_NAME | ( | params, | |
| sheet | |||
| ) |
Definition at line 355 of file xlm_library.py.
| def XLM.xlm_library.SET_VALUE | ( | params, | |
| sheet | |||
| ) |
Definition at line 519 of file xlm_library.py.
| def XLM.xlm_library.should_emulate_cell | ( | cell | ) |
Check to see if a given XLM cell runs something that we want to track in the actions.
| cell | (XLM_Object) The cell to check. |
Definition at line 697 of file xlm_library.py.
| def XLM.xlm_library.SUM | ( | params, | |
| sheet | |||
| ) |
Definition at line 464 of file xlm_library.py.
| def XLM.xlm_library.SUMIF | ( | params, | |
| sheet | |||
| ) |
Definition at line 459 of file xlm_library.py.
| def XLM.xlm_library.User_Defined_Function | ( | params, | |
| sheet | |||
| ) |
Definition at line 449 of file xlm_library.py.
| def XLM.xlm_library.VBA_INSERT_FILE | ( | params, | |
| sheet | |||
| ) |
Definition at line 599 of file xlm_library.py.
| def XLM.xlm_library.WAIT | ( | params, | |
| sheet | |||
| ) |
Definition at line 170 of file xlm_library.py.
| def XLM.xlm_library.WHILE | ( | params, | |
| sheet | |||
| ) |
Definition at line 489 of file xlm_library.py.
| def XLM.xlm_library.WINDOW_MAXIMIZE | ( | params, | |
| sheet | |||
| ) |
Definition at line 325 of file xlm_library.py.
| def XLM.xlm_library.WINDOW_RESTORE | ( | params, | |
| sheet | |||
| ) |
Definition at line 271 of file xlm_library.py.
| def XLM.xlm_library.WINDOW_SIZE | ( | params, | |
| sheet | |||
| ) |
Definition at line 283 of file xlm_library.py.
| def XLM.xlm_library.WORKBOOK_COPY | ( | params, | |
| sheet | |||
| ) |
Definition at line 551 of file xlm_library.py.
| def XLM.xlm_library.WORKBOOK_HIDE | ( | params, | |
| sheet | |||
| ) |
Definition at line 153 of file xlm_library.py.
| def XLM.xlm_library.WORKBOOK_INSERT | ( | params, | |
| sheet | |||
| ) |
Definition at line 541 of file xlm_library.py.
| def XLM.xlm_library.WORKBOOK_NAME | ( | params, | |
| sheet | |||
| ) |
Definition at line 556 of file xlm_library.py.
| def XLM.xlm_library.WORKBOOK_PREV | ( | params, | |
| sheet | |||
| ) |
Definition at line 566 of file xlm_library.py.
| def XLM.xlm_library.WORKBOOK_SELECT | ( | params, | |
| sheet | |||
| ) |
Definition at line 259 of file xlm_library.py.
| def XLM.xlm_library.WORKBOOK_UNHIDE | ( | params, | |
| sheet | |||
| ) |
Definition at line 343 of file xlm_library.py.
| bool XLM.xlm_library.debug = False |
Definition at line 12 of file xlm_library.py.
| dictionary XLM.xlm_library.func_lookup = {} |
Definition at line 22 of file xlm_library.py.
| list XLM.xlm_library.funcs_of_interest = [] |
Function emulators.
Definition at line 19 of file xlm_library.py.


|
rolmodl
C++ API for the Simple Directmedia Library 2 (SDL2)
|
rolmodl is a C++ API for the Simple Directmedia Library 2 (SDL2). The overhead is minimized, as long as this does not compromise other design goals. In general, the abstraction layer varies in depth quite a lot.
An example program is available that showcases some of the features and their inteded use.
The todo files list the features that were left unimplemented in the meantime. The project todo is a developer reference of porject goals and shorcomings
rolmodl uses Shake. It depends on SDL2.
After installing the dependencies, simply run ./build.sh
from the project folder.
Include the rolmodl header: ./src/rolmodl/hpp/Rolmodl.hpp
. Link with the rolmodl shared library ./dist/dbg/librolmodl.dylib
(or your OS equivalent).
Use ./run.sh
to run the test application.


I am an entrepreneurial product manager with hands-on experience in software engineering, international business development, and team leadership. I pride myself in my ability to understand others via their perspective and am passionate about exploring my personal and professional frontiers.
On this website, you’ll find my portfolio as well as a blog of things that I’m passionate about: Software, Product ideation & Travel experiences.
Read More…
The Modern Business template by Start Bootstrap includes:
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Corporis, omnis doloremque non cum id reprehenderit, quisquam totam aspernatur tempora minima unde aliquid ea culpa sunt. Reiciendis quia dolorum ducimus unde.
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Molestias, expedita, saepe, vero rerum deleniti beatae veniam harum neque nemo praesentium cum alias asperiores commodi.


What does function "fun" do when called
with some array x and n = 0?
It finds the largest value in x and leaves x unchanged.
- It finds the smallest value in x and leaves x unchanged.
- It sorts x in ascending order and returns the largest value in x.
- It sorts x in descending order and returns the largest value in x.
- It returns x[0] or x[n-1] whichever is larger.
Do you seen any assignments to the array?
Do the comparisons keep the largest or the smallest
value?


Screenshot of Lunar Magic's palette editor:
Press Ctrl+V to paste an image from your clipboard.
Download .PAL


Internet service providings taken from season 1, episode 1. Taking cold-calling to an artform, the Fonejacker is a man on a mission. He's addicted to making ...
Acura01-Feb-19 10:49 AM
The Canadian crypto exchange "QuadrigaCX" has lost access to its cold-wallets (including customers' crypto currencies) and filed a petition with the Supreme Court.
 Zilliqa has proven to provide both these benefits.
Has Zilliqa proven that?
With the ZIL mainnet launch scheduled for the 31st of January 2019, many crypto enthusiasts and developers on the blockchain have postulated that the entrance of Zilliqa into the ecosystem will change the game completely. This is primarily due to the following reasons:
How can they prove anything when they dont even have their mainnet online lol


pickle.dump(self.classifier, open(full_path, "wb"))
// Get MNIST
(_, _), (x_test, y_test) = self.mnist
// Unpickle:
with open(full_path, "rb") as f:
sess.close()
def test_pickle(self):
classifier, sess = get_classifier_tf()
full_path = os.path.join(DATA_PATH, "my_classifier")
folder = os.path.split(full_path)[0]


rates evolutionary HIV- population time individuals viral synonymous nonsynonymous within-host consensus evolution gene substitution data mismatch diversity []. rate sequences transmission individual infection virus mutations using sites mean sequence subtype viruses Fig multiple expected point additional changes likely variants HIV analysis different estimated selection similar {border-style infected number px;} region #ffffff;} bias estimates founder-like lineages observed polymorphic proportion Biology Click LINK [], divergence file. regions sampling (Fig Sciences Viral between-host samples study subtypes Fig). Evolution (PDF) Evol. Life Pathogens Rakai Virus calculated high transmitted used Biol. Evolutionary codon consistent founder given sampled United Virol. compared load model phylogenetic posterior previous sample store years adapt associated available genome infection, level method pairwise point, recombination review sequenced sequencing strong within- ./JVI.- Department HIV: LemeyP, Microbiology Research SPVL Uganda Uganda, Viruses analysis, counting disease hierarchical important individuals. measured patterns px; revert short sites, subtype-specific {font-family CTL Comput However, Mean States approximately assumed considered donor dynamics early font-size gp. higher human immunodeficiency individuals, infection. nucleotide points progression ratio ratios reads regions, scale set-point significant supported (see BEAST Bayesian Biol Diversity Infect Infection Microbial Mol Oxford, Proc Row: SuchardMA, [,]. addition, allele amplification based branches change changes; consensus, correlation correspond distinct double; env error evolves faster genome. host identical observation populations positions previously probably purifying renaissance resulting row). selection, single substitutions, suggests tested type untreated America[], Black, Blue, Dis. Health Here, Hopkins Immunodeficiency Johns MD, Medicine, Moreover, RNA RambautA, Red, analyses bars border-color border-width calculating contribution course days deep-sequencing determined errors examined frequency genetic gp, greater individual, individual. infections large lines molecular mutation mutations, original pattern percentiles population, positive predicted pressures rates, rates. removed. replication retrieve retrieve, seroconversion shown solid; stronger substitutions support times tree understanding {font-style {font-weight (Table (or ./pnas. Acad Cohort Community District Furthermore, Institute, Lemey LemeyP. Lentivirus Medical Medicine Natl Organisms Population PybusOG, Research, Retroviruses Sci Science Study Transmission Uganda. University, Using [–]. absence accumulated and/or approach assuming backbone background bold changes, circles) combined consensus. contribute contributing corresponds courier; data. dataset datasets deleterious determine distance e./journal.pcbi. em; evolution. explain first, fitness hypothesis indicate inferred information internal, line linear low mechanisms mutational mutations. observations occur point. preferentially processes pt;} pure rapidly region, relative represents respectively). results role scale. seen slower stochastic structure study, study. subsequent subset sufficient timescales transition transversion tree. use


Slogger
A simple, fast and flexible logging framework for Swift.
Why Another Swift Logging Framework?
When I started doing serious Swift development, I naturally looked around for a logging framework. I found XCGLogger by Dave Wood @DaveWoodCom. While it’s fast and well constructed, I needed some extra features and decided to build my own. But I did learn a few things from him so he deserves some props. 🍺🍺🍺
Slogger uses much the same approach and identical function signatures as XCGLogger, so they are interchangeable without modifying existing logging sites. Be sure to check the Advanced Features section below – particularly Radioactive Logging and Categories – to see why I decided to go this route.
Also note: Slogger is completely API independent, except for the Swift standard library and the Foundation
import. So it can be used in Mac OS X projects projects as well.
Slogger requires Xcode 7.1 and Swift 2.1.
General Info
Logging Levels
The typical logger levels are supported:
public enum Level : Int, Comparable {
case None, Severe, Error, Warning, Info, Debug, Verbose
static let allValues = [None, Severe, Error, Warning, Info, Debug, Verbose]
}
The order of the levels is higher-priority first. Thus the threshold is evaluated using the <= operator. Here’s the function that’s used internally to determine if a message should be logged. (See below for information on the override and category parameters.)
public func canLog (override override: Level?, category: T?, siteLevel: Level) -> Bool {
let effectiveLevel : Level
if override != nil {
effectiveLevel = override!
} else if category != nil, let categoryLevel = categories[category!] {
effectiveLevel = categoryLevel
} else {
effectiveLevel = level
}
return effectiveLevel == .None ? false : siteLevel <= effectiveLevel
}
Creating a Slogger Instance
Setting up a logger can be as simple as one line of code:
let log = Slogger<NoCategories>(defaultLevel: .Info)
And you’ll likely want to tailor your build for debug/release:
#if DEBUG
let log = Slogger<NoCategories>(defaultLevel: .Info)
#else
let log = Slogger<NoCategories>(defaultLevel: .Warning)
#endif
The public interface is fully documented in the headers for reference in Xcode (use Alt-Click). See the Docs directory for an HTML-based version. (At some point there will be a docset available, but at the moment there are issues with both Jazzy and AppleDoc that I haven’t had time to resolve.)
The Slogger class is generic to support categories, as explained below.
Logging Site Functions
Each log level has autoclosure and noescape trailing closure implementations, so the following are both valid forms:
log.debug("Enter")
log.debug() { "Enter" }
Important Note: The resulting closures are not evaluated if the logging site doesn’t pass the level threshold. So don’t worry about expensive computations inside them. And don’t rely on them for side-effects.
For completeness, functions are provided for the .None level that have no-op implementations. Thus the only overhead would be allocating the closure on the stack and the function call. You can use them to effectively disable certain logging sites with the highest efficiency. (See the Performance sections below for more details.)
log.none("Enter")
log.none() { "Enter" }
Log Instance Properties
The following properties of each log instance are exposed and have read/write access (except for default implementations). They can be modified at runtime, either programmatically or by using the debugger at a breakpoint.
| Property | Type | Comments |
|---|---|---|
| level | Level | The active, global level of the logger instance. |
| categories | [T : Level] | A mapping between categories and levels. |
| destinations | [Destination] | Destinations this logger will write to. Defaults to ConsoleDestination with XcodeColors decorator. |
| hits | UInt64 | Number of events logged. |
| misses | UInt64 | Number of events not logged due to logging threshold evaluation. |
Implementation Note
Slogger uses a private, serial dispatch queue for most of its work, including calls to the
generator, decorator, and all logging destinations. The only code executed synchronously by the
logging functions is threshold evaluation (and only if destinations.count > 0
) and,
if that passes, evaulation of the closure to produce the message from the logging site.
Thus, all Slogger types are inherently thread-safe. If you decide to implement your own, you can
do so without concern for concurrency issues. However, if you create a custom implementation
of any type that requires code be executed on the main thread, you MUST wrap that code inside a
dispatch_async
call to the main queue.
Advanced Features
Destinations
The Destination class allows you to write your own log destination subclasses and add them to the logger. The following destinations are provided in the implementation:
| Class | Status | Notes |
|---|---|---|
| ConsoleDestination | ✔ | Defaults to sensible output with XcodeColors support |
| MemoryDestination | ✔ | Appends entries to in-memory array. |
| TextFileDestination | ✔ | Mimics ConsoleDestination behavior by default w/o decoration |
| JSONFileDestination | ✔ | Outputs one-entry-per-line JSON format |
| XMLFileDestination | ✔ | Outputs one-entry-per-line XML format |
| TabFileDestination | ✔ | Outputs tab-delimited files. |
| CSVFileDestination | ✔ | Outputs comma-separated values files. |
| NetworkDestination | 🤔 | Planned but no ETA |
Generators
These are classes that output a log entry based on information from the logging site. They are configurable per logging destination. You can use the provided generators or implement your own.
The default uses the typical pattern:
- [2015-11-07 23:53:18.187 -0500] File.swift (82) function() [] Error : Message...
List of supported generators (see the source for details):
| Generator | Status |
|---|---|
| Generator | ✔ |
| JSONGenerator | ✔ |
| XMLGenerator | ✔ |
| CSVGenerator | ✔ |
| TSVGenerator | ✔ |
Details
You can configure what details you want to see in the logs – and in what order – by providing an array of enum values for each detail supported. This makes it easy to customize your output format.
The default value includes all available Detail values, in a typical order:
[.Override, .Date, .File, .Line, .Function, .Category, .Level, .Message]
Configurable Decorators
You can supply a decorator that will further adjust the format of the generator output. These are configured per destination.
| Decorators | Status | Info |
|---|---|---|
| XcodeColors | Supported | Get XcodeColors. |
| ANSI | On Hold | Currently trying to sort out supporting this. |
Configurable Colormaps
Make your own color map to customize log entry color by Level in a platform- and decorator-independent way. See the ColorMap type for more information. (Note: You can use the XcodeColorsDecorator class for non-log use in your console without writing your own.)
Radioactive Logging
Radioactive logging allows logging to execute based on evaluation of an optional override value at logging sites. If the override value is non-nil, it is evaluated first. If the level of the logging function is less than or equal to the override value, the site will be logged. If not, logging threshold evaluation will proceed by the normal process.
As an example, imagine you have a Request object base class in a services implementation. You could define a logOverride property of type Level, defaulting to nil. In the service code that processes requests, you would then provide the value of the logOverride property of requests as the override parameter at all logging sites. This would cause any non-nil value in requests being processed to be used to override logging for the service.
As a use-case, if you had a service that was processing tons of request, but a specific one was failing in a subtle way, you could use the following procedure to get more information for just that request, as follows:
- Add code to set a logOverride value (typically .Verbose) where the request is created
- Set the activeLevel property in the log instance to .None
- Run your code
You would then see logging for only that specific request, at whatever level you specified as the override. This allows you to focus diagnosis on a particular object as it flows through the system, rather than getting a firehose of logging information for requests that you don’t care about if you were to simply set the logger’s level property to a higher value.
This procedure can be done by simply modifying your code at the site of creation of the request, or it can be done by setting a breakpoint at runtime and using the debugger to modify the properties.
Categories
In addition to the two logging site functions for each level mentioned above, Slogger adds two more with an additional Category parameter. While a category could be any type conforming to the protocol, it’s best to define them as an enum for type safety and convenience.
Once the categories are defined, you can configure your logger to customize the logging level for that category (.Debug or .Verbose, for example), even at runtime. This allows more fine-tuning of logging if, for example, you want to see more logging of the events for a particular concern (database calls, networking transactions, etc).
The design of Slogger also allows third-party frameworks that use it to expose their log instance and document their category values for developers using them. If you need to diagnose a problem inside the framework, you can simply adjust the logging levels for particular categories – or make objects radioactive if the framework supports it – to get more information. This is particularly useful in cases where the framework developer doesn’t release the source code.
Implementing Categories
Here’s an example of how you should implement your custom categories and your Slogger subclass.
First, define your category enum:
public enum MyCategories : String, SloggerCategory {
case Foo, Bar, Baz
}
}
Second, subclass the generic Slogger class to bind it to your category type:
class MyLogger : Slogger<MyCategories> {}
Then create your logger in the obvious way:
public let log = MyLogger(defaultLevel: .Info)
Naturally, if you want your logger to have customized values (generators, decorators, etc.), you can override the init method and provide that information there.
 And since your Swift code defines a module, you a) don’t have to worry about name collisions, and b) can document your categories and allow other modules to modify its behavior, as described above.
Performance
Here are initial performance figures for logging calls with a release build (as of version 1.0). See the PerformanceTest class and SloggerPerformanceIOS project for details. (The performance of Slogger for Mac OS X applications should be identical to that of the simulator.)
| Destinations | Level | Can Log | Simulator | iPhone 6 |
|---|---|---|---|---|
| [] | Verbose | true | 53ns | 108ns |
| [MemoryDestination] | Severe | false | 374ns | 1µs |
| [ConsoleDestination] | Severe | false | 370ns | 1µs |
| [JSONFileDestination] | Severe | false | 463ns | 1µs |
| [XMLFileDestination] | Severe | false | 425ns | 1µs |
| [MemoryDestination] | Verbose | true | 3µs | 8µs |
| [ConsoleDestination] | Verbose | true | 4µs | 15µs |
| [JSONFileDestination] | Verbose | true | 4µs | 10µs |
| [XMLFileDestination] | Verbose | true | 12µs | 16µs |
It’s clear from the timing that if you want to completely turn off logging in the most efficient way, set the destinations property to an empty array. This avoids even performing the level threshold test.
It should be noted that the timing for where Can Log is true does not include the generator, decoration or destination overhead. If a site can log, the only thing done inline is evaluating the message closure (required because it’s noescape). The rest of the work is done via dispatch_async
to a private, serial queue.
Feedback
Please do use the issues section on Github report bugs, raise questions, offer suggestions for improvements or ask questions about the implementation. And if you want to contribute, feel free to discuss it in the issues section and/or issue a pull request.
Happy logging!
Version History
| Version | Status | Comments |
|---|---|---|
| 1.0 | Released | First release. |
| 0.1.x | Available | Pre-release (CocoaPods/Carthage support and TextFileDestination variants). |
TODO
- Make docset


Jan. 29, 2014, midnight
Finally! Our new site is up and running! Unfortunately it still looks pretty much like the one from last year but we will improve the design in the coming weeks.
Even though the site looks like the old one, a lot has changed under the hood:
Besides the new design there are still two things left to do:
With those two features in place we can give speakers the chance to know their audience in advance. We hope that this will allow speakers to adjust the difficulty of the talk to the experience levels of their audience. We would also get an idea which talks spark a lot of interest and we will try to schedule "hot" talks in such a way so that they don't clash with each other.


We will be staying in Ravello (exact location tbd and to be updated here)- we recommend you do too. Buses and ferries can be used to get to other towns on the coast for visits. There are no shortage of places to stay in Ravello, however we recommend you book early. Ravello consists of two parts: main Ravello on the mountain and Ravello by the sea. We would not recommend staying in Ravello by the sea unless you want to climb 700 + very steep steps, or walk 7km to the wedding venue. Here are a few recommendations to get you started:
Very near to the center of town, Graal Hotel offers excellent hillside views from their rooms and pool. About a 5 minute walk to the church and an 15 minute walk to the reception venue Graal Hotel offers convince that is lost with the hotels outside of town. Book directly and mention Gabriella and Chris' wedding to receive 10% off 3+ nights stay.
A bit further away, but more spacious, Villa Piedimonte still offers spectacular views, great amenities, and a relaxing pool. An excellent choice but not for those who dislike uphill walks, it's about 15 minutes to the center of town and 25 minutes to the reception.
The site of our reception, Hotel Caruso, for those looking to splurge on a once in a lifetime experience. Formally an 11th century palace, the hotel is run by the Belmond hotel chain, known for their opulent retreats. Number 1 rated on TripAdvisor, you'll defiantly be wowed.
Vacation rentals are the most affordable option on the coast, great for groups, and come in a variety of options like cozy apartments or large villas with a pool. TripAdvisor (we swear Gabriella doesn't get a cut!) and Airbnb have the most options in the area. Beware the that the terrain is hilly and the map deceptive. Places are further away in distance and elevation than they look! Many homes are 10+ flights of stairs from the main road. We recommend asking before booking.


Hello there, awesome person!


KERALA TOURISM
Home
(current)
Districts
(current)
Sign Up
(current)
Sign In
(current)
Search
Name
*Only alphabets and space
Phone number
*Only numbers and format:normal or XXX-XXX-XXXX, XXX.XXX.XXXX, XXX XXX XXXX
Email
*valid email address
Password
*Minimum 8 characters, at least one uppercase, and one lower case, must contain at least one number
LogIn


Mera Bharat
Home
Gallery
About
Contect
Welcome in India
How are You
onced time come in india
learn more
Signup here


Note that the Polyline entity is experimental! Breaking changes may occur at short notice while the code continues to be developed
The interplay between using absolute/relative coordinates and artefacts as pins, mapping to pins, pivoting the entire line to an artefact, and other artefacts using line pins as their pivot values (plus handles, offsets, dragging, etc) ... can be a bit confusing. This demo represents (current) expected behaviour.
The Polyline is draggable in this demo, as are the green and red pins:
Tension
-0.5 - 1.5
Coordinates
Closed
Pivot to
Map to pins
Use as path
Flip reverse
Flip upend
Roll
Scale
Test purpose
Polyline-specific tests:
Create some sets of coordinate Arrays (absolute values, relative values, artefacts)
Create a Polyline entity from the first set of coordinates
Check that the tension attribute updates correctly (Polyline bendiness will change)
Check that the Polyline can be dragged, whatever the setting of the closed flag
Check that the Polyline can be pivoted, including to the mouse cursor
Check that the Block entitys remain attached to the Polyline in all situations
Check that the Polyline responds as expected when we change its pins Array
Check that when the Polyline is set to the Wheel coordinates Array, it responds when those Wheels are dragged into new positions
Check that the Polyline can be scaled, flipped and rolled.
Natural and constant speed animation along a path:
Check that the green and yellow 'ball' Wheels correctly follow the Polyline path at all times when 'useAsPath' flag is set, and does not break the demo when the flag is not set.
Confirm that the yellow 'balls' correctly move at a constant speed when animating along the Polyline path.
Known issue: when the 'useAsPath' flag is set to false, the Block pins do not position themselves as expected when the Polyline entity is rolled, flipped or scaled. If this functionality is required on a Polyline, always set its 'useAsPath' flag to true.


We'll need to import libraries to help with data processing and machine learning. Import sklearn
, numpy
and matplotlib
libraries by the following:
from sklearn.ensemble import RandomForestRegressor import numpy as np from matplotlib import pyplot as plt


 In most instances they get by without having to but in some they struggle when they don’t. Sales representatives in oil companies and fast-moving-consumer-goods (FMCG) plus corporate and wealth managers in banks and investment firms are examples of sellers who find themselves in this dilemma.
This happens because their buyers are businessmen and they are employees. An employee’s thinking is as different from a businessman’s as day is from night. The employee works in a structured environment, with a regular income and his financial horizon is usually 30 days to the next salary; the businessman is intensely focused on the success of his business, a comparatively unstructured environment, erratic income and a long term financial horizon. He is not a buyer you will ‘push’ a product to that does not make business sense to him.
For instance, in addition to overseeing the supply of the contractual amount of fuel say 10,000 litres to the dealer (petrol station owner) the oil company’s reps job is to ‘push’ more sales with every depletion. Phone calls, visits and emails insisting on this rarely help. Understanding business, banks have Premier Business Clubs to as a platform for their businessmen clients to network and FMCGs have aggressive marketing campaigns ‘pulling’ customers to ask for their product much as the distributor has already bought them.
The salesperson though must offer a ‘push’ with business sense. This starts with a genuine interest in the buyer’s business and therefore gaining his trust. I once read in Forbes that to be useful to an organization, find out what keeps the CEO (who is a businessman) awake at night and make it your business during the day. To succeed in selling, understand what the businessman wants from his business and make it your business to help him succeed. The typical employee response I get whenever I ask this question is, “it’s just money he wants”, as if to suggest the employee would work for free! It could be he wants recognition or to plug an income leakage for his fleet of lorries. Remember he’s depositing Ksh. 10M as security with your oil company was not for lack of an alternative avenue to invest it in. With genuine understanding, it becomes easier to help him succeed in achieving his goal and easier to present a business case to your employer (the other business you represent) why the delayed payment has occurred and how it will be settled in a win-win fashion. Bereft of such a case, credit control follows what the policy says, and the account is suspended or closed and your selling is impeded.
The businessman’s frame-of-mind is solution-oriented. He wants to know how it can be done, not why it cannot. Company policy is therefore subject to interpretation for the progressive seller. This does not imply practising unethical practices. No. It implies not wearing blinders in the application of the policy and using policy as a guideline not deadline to protect your employer while growing and retaining business.
The progressive representative therefore visits the dealer’s clients with him and even presents credible cases to him on how to increase traffic to his fuel station; thus he can justify to the dealer why he should replenish when he requests him to, because there is business sense to it. And the more the dealer replenishes, the more the oil company sells and the more the salesperson sells too. And all because he thought and acted like a businessman.


---
layout: page
title: Staff in Mind Application Form
main_image_path:
main_nav: false
style: practice
permalink: /practice/groups-for-staff-in-mind/application/
sidebar:
jotformid:<PHONE_NUMBER>13356
_inputs:
jotformid:
type: number
label: Jotform ID
comment: Add the unique string of numbers that identifies your form on Jotform
---
Mindfulness-based Cognitive Therapy (MBCT), Mindfulness-based Cognitive Therapy for Life (MBCT-L) and Mindfulness Based Stress Reduction (MBSR) Courses for Health and Social Care Staff


I'm KEERTHANA RAGHAVAN pursuing my final year Bachelor of Engineering In Computer Science at Sri Shakthi Institute Of Engineering & Technology.I'm Web Developer. I’m currently working on myself for myself by myself.I’ve always sought out opportunities and challenges that are meaningful to me. Although my professional path has taken many twists and turns. I've never stopped engaging my passion to help others and solve problems. As a web developer, I enjoy using my obsessive attention to detail, my unequivocal love for making things, and my mission-driven work ethic to literally change the world. That's why I’m excited to make a big impact at a high growth company.
NAME : KEERTHANA R
AGE : 21
JOB TITLE : WEB DEVELOPER
LOCATION : COIMBATORE,TAMILNADU
This project establishing an online presence and selling service. This site in which customer is provided with the service like (make ups ,hairstyles etc.) .And the appointment will be fixed by submitting their preffered look.
We made an application that helps to overcome the problem of finding a parking space using android studio. This application can be used in parking area where we find a long queue for parking the vehicles which consumes more time. It excludes the need of human efforts for managing parking spaces.
MY ACADEMIC PERFORMANCE
ACADEMIC YEAR :APR-2017
comment 5HSC STREAM:COMPUTER SCIENCE PECENTAGE:88%
ACADEMIC YEAR :SEP-2017-MAR-2021
commentSTREAM: COMPUTER SCIENCE AND ENGINEERING CGPA:7.63


sumudu siriwardana
I'm a Project Manager who is curious about states of product design and engineering processes. I like to work on
different stages of products to get hands-on experience with other roles to understand the technicalities.
While my main focus is on project management, I'm currently learning web development and really enjoying the coding
journey. Working with tech teams and different technologies inspired me to start my web development journey.
+ html
+ css
+ javascript
+ agile
+ lean
+ project management
+ product management


Contents
API javadocs
Service examples
Reading/writing service descriptions
Translating older service descriptions
OWL-S Validation
Loading cached ontologies
Executing services
Execution monitoring
Creating composite processes
Using OWL resources
WSDL support
Tutorial
API javadocs
The javadocs of the API is included in the distribution file. You can access the online version here.
Service examples
There are couple of example OWL-S files here http://www.mindswap.org/2004/owl-s/services.shtml. These services are all grounded in actual WSDL services and can be executed with the API. These are simple service descriptions to show different features in OWL-S such as how to define XSLT transformations in groundings, how to define CompositeProcesses and data flows and so on.
The examples directory in the distribution file contains example code that shows how to use these service descriptions in the API.
Reading/writing service descriptions
There are two important interfaces in the OWL-S API: OWLOntology and OWLKnowledgeBase. OWLOntology represents the information stored in a single file and an OWLKnowledgeBase is a collection of ontologies. RDF data (triples) can only be added to OWLOntology objects and only OWLOntology objects can be serialized. There is one base ontology associated with each KB that is used to store data (for example after execution new instances will be added to this ontology).
OWLKnowledgeBase.read(URI)
function reads the file from the given ontology and loads the generated OWLOntology to the KB. OWLOntology.getService() can be used to get the service instance from the ontology (OWLOntology.getServices() if there are multiple services).OWLKnowledgeBase.readService(URI)
(and resp.OWLKnowledgeBase.readServices(URI)) function will automatically do that.
If an error occurs during parsing these functions will return null value. See next section about validation to get more info about catching these problems.The ontology associated with a service can be serialized using OWLOntology.write(Writer) function.
// create a URI for the service (note that this is a 0.9 version file)
"http://www.mindswap.org/2004/owl-s/0.9/ZipCodeFinder.owl"
URI uri = new URI();
// create a KB
OWLKnowledgeBase kb = OWLFactory.createKB();
// create a generic reader and a 1.0 writer
OWLOntology ont = kb.read(uri;
// get the service
Service service = ont.getService();
// write the output to console (a file stream can also be used here)
ont.write(System.out);
Translating older service descriptions
There is limited support for older versions of OWL-S. Currently, API natively supports 1.1 version and provides translators for 1.0 version. Translation should be enabled with the OWLKnowledgeBase.setAutoTranslate(true) function call.
OWL-S Validation
The validation feature has not yet been implemented.
Loading cached ontologies
Sometimes it is desirable to use cached versions of the files rather than downloading the remote files. The OWLCache class provides the functionality for this purpose. OWLCache.setLocalCacheDirectory(String) specifies a directory to find the cached files. The cache dir should include a file named service.idx that has the mappings from URI's to local file names. This index file is a text file where each line is in the format
[service description url]=[local filename]
The ':' characters in the url's should be escaped as "\:". See
Properties.load()
for more details about the file format. You may choose to add file entries one by one using theOWLCache.addCachedFile()
function. When there is a cache entry for a file, the cached version is only used when the original file cannot be found (e.g. no connection). It is also possible to give more priority to cached files and try to get the remote file only if there is no cached version. SeeOWLCache.setForced(boolean)
for this functionality. Remember to include an xml:base statement in your cached files so that URIs generated from your local file will be exactly same as the remote one.There is one OWLCache assocaited with each OWLReader. OWLKnowledgeBase.getReader().getCache() will return the cache assocaited with a KB.
Executing services
Executing a service means executing the process it has. The process should have a valid grounding specification in order to invoke the service successfully. The WSDL and UPnP groundings are supported by the API. A process is executed by the
ProcessExecutionEngine.execute(Process, ValueMap)
function where second parameter specifies the values for input parameters. This function returns anotherValueMap
which contains the output value bindings. The following code segment shows an example of executing a service:// create an execution engine
ProcessExecutionEngine exec = OWLSFactory.createExecutionEngine();// load the service description
Service service = kb.readService("http://www.mindswap.org/2004/owl-s/1.0/Dictionary.owl");
// get the process of the service
Process process = service.getProcess();
// create an empty value map
ValueMap values = new ValueMap();
// set the value of input parameter
values.setDataValue(process.getInput("InputString"), "computer");
// execute the process with the given input bindings
values = exec.execute(process, values);
// get the output value as a string
String outValue = values.getStringValue(process.getOutput());
// display the result
System.out.println("Output = " + outValue);
The above is a simple example where the input is a simple XML Schema string. However, some services will have complex input types that are represented by OWL classes. In this case, the value of input parameter can be set to an OWLIndividual. SeeRunService.java
in the examples directory for more examples of this kind.
Execution monitoring
It is possible to see the progress of execution when a complex service is being executed. ProcessExecutionListener defines a set of minimal functions for this purpose. simply use the
ProcessExecutionEngine.addExecutionListener(ProcessExecutionListener)
to set a listener on the execution engine. SeeRunService.java
in the examples directory for examples of how to use the listener.
Creating composite processes
It is possible to create service descriptions, profiles or processes programmatically.
OWLOntology
provides functions to create any of these structures.CreateSequence.java
in the examples directory shows an example of how to do this. The following code snippet shows the main idea:/**
*
* Create a new Sequence from the processes of the given services and put them in a new
* Service.
*
* @param services List of Services
* @param baseURI The base URI for the generated service
* @return The Service which is a Sequence of the given services
*/
Service createSequenceService(List services, String baseURI) {
// create an empty ontology
OWLOntology ont = OWLFactory.createOntology();
// create a new service
Service service = ont.createService(URI.create(baseURI + "Service"));
// create a new composite process
CompositeProcess process = ont.createCompositeProcess(URI.create(baseURI + "Process"));
// create a new sequence construct
Sequence sequence = ont.createSequence();
// put the sequence into composite process
compositeProcess.setComposedOf(sequence);
for(int i = 0; i < services.size(); i++) {
// get the service from the list
Service s = (Service) services.get(i);
// get the process fron the service
Process p = s.getProcess();
// create a perform construct
Perform perform = ont.createPreform();
perform.setProcess(p);
// put the process into the sequence
sequence.addComponent(p);
// create data flow if necessary...
}
// create profile...
// create grounding
return service;
}
Using OWL resources
Every resource in the API (
Service,
Profile,
Process,
etc.) extendsOWLIndividual
which provides the basic functionalities to get and set object and data properties for any OWL individual. If additional information is required about the resources then the underlying RDF model can be queried. OWLIndividual.getImplementation() returns the implementation specific object. Right now, API is built on top of Jena so the function will return the corresponding Resource in the Jena model.In the future releases it is planned to add support for OWL API.
WSDL Support
The API contains a package org.mindswap.owls.wsdl that provides support for reading and executing WSDL services. Execution of OWL-S services is achieved through this package. The WSDL functionality is based on Axis package version 1.1. The main functionality added to Axis is the ability to execute services with complex inputs dynamically without a need to create stubs or extra code. The SOAP messages are created from the string representation of XML Schema complex type. This invocation method is not robust but works for most of the cases.


Last updated: 2021-03-11
Checks: 7 0
Knit directory: fastTopics-experiments/analysis/
This reproducible R Markdown analysis was created with workflowr (version 1.6.2). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.
Great! Since the R Markdown file has been committed to the Git repository, you know the exact version of the code that produced these results.
Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.
The command set.seed(1)
was run prior to running the code in the R Markdown file. Setting a seed ensures that any results that rely on randomness, e.g. subsampling or permutations, are reproducible.
Great job! Recording the operating system, R version, and package versions is critical for reproducibility.
Nice! There were no cached chunks for this analysis, so you can be confident that you successfully produced the results during this run.
Great job! Using relative paths to the files within your workflowr project makes it easier to run your code on other machines.
Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility.
The results in this page were generated with repository version 6f16f8e. See the Past versions tab to see a history of the changes made to the R Markdown and HTML files.
Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use wflow_publish
or wflow_git_commit
). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:
Ignored files:
Ignored: data/GSE103354_Trachea_droplet_UMIcounts.txt.gz
Ignored: data/droplet.RData
Ignored: data/pbmc_68k
Ignored: data/pbmc_68k.RData
Ignored: output/newsgroups/fits-newsgroups.RData
Ignored: output/newsgroups/rds/
Ignored: output/nips/fits-nips.RData
Ignored: output/nips/rds/
Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.
These are the previous versions of the repository in which changes were made to the R Markdown (analysis/prepare_droplet.Rmd
) and HTML (docs/prepare_droplet.html
) files. If you’ve configured a remote Git repository (see ?wflow_git_remote
), click on the hyperlinks in the table below to view the files as they were in that past version.
| File | Version | Author | Date | Message |
|---|---|---|---|---|
| Rmd | 6f16f8e | Peter Carbonetto | 2021-03-11 | Added code and R Markdown for preparing trachea droplet data. |
Here we prepare the “droplet” UMI count data from Montoro et al (2018)—these are gene expression profiles of trachea epithelial cells in C57BL/6 mice obtained using droplet-based 3’ single-cell RNA-seq—for topic modeling analysis.
Download file GSE103354_Trachea_droplet_UMIcounts.txt.gz
from the Gene Expression Omnibus (GEO) website, accession GSE103354, and save this file to the “data” folder. Edit the first line of this file so that the column names are “gene”, “M1_GCTTGAGAAGTCGT_Club”, “M1_GGAACACTTTCGTT_Club”, etc.
Load the readr package, and a couple others, and load some functions written specifically for loading and preparing the data.
library(Matrix)
library(readr)
library(tools)
source("../code/droplet.R")
The UMI count data are imported as a matrix, with one row per tissue sample and one column per gene.
out <- read_droplet_data("../data/GSE103354_Trachea_droplet_UMIcounts.txt.gz")
samples <- out$samples
counts <- out$counts
rm(out)
Remove genes that are not expressed in any of the cells.
j <- which(colSums(counts > 0) >= 1)
counts <- counts[,j]
This data set contains UMI count data for 7,193 samples and 18,388 genes expressed in at least one cell. The count data are sparse; over 90% of the counts are zero.
cat(sprintf("Number of genes: %d\n",ncol(counts)))
cat(sprintf("Number of samples: %d\n",nrow(counts)))
cat(sprintf("Proportion of counts that are non-zero: %0.1f%%.\n",
100*mean(counts > 0)))
# Number of genes: 18388
# Number of samples: 7193
# Proportion of counts that are non-zero: 9.3%.
Gene expression was profiled in cells from 6 different mice:
table(samples$mouse.id)
#
# M1 M2 M3 M4 M5 M6
# 212 1679 2211 2222 327 542
In the Montoro et al analysis, the samples were subdivided into 7 cell types:
table(samples$tissue)
#
# Basal Ciliated Club Goblet Ionocyte
# 3845 425 2578 65 26
# Neuroendocrine Tuft
# 96 158
Convert the count data to a sparse matrix.
counts <- as(counts,"dgCMatrix")
Save the processed data.
save(list = c("samples","counts"),file = "droplet.RData")
resaveRdaFiles("droplet.RData")
sessionInfo()
# R version 3.5.1 (2018-07-02)
# Platform: x86_64-pc-linux-gnu (64-bit)
# Running under: Scientific Linux 7.4 (Nitrogen)
#
# Matrix products: default
# BLAS/LAPACK: /software/openblas-0.2.19-el7-x86_64/lib/libopenblas_haswellp-r0.2.19.so
#
# locale:
# [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
# [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
# [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
# [7] LC_PAPER=en_US.UTF-8 LC_NAME=C
# [9] LC_ADDRESS=C LC_TELEPHONE=C
# [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
#
# attached base packages:
# [1] tools stats graphics grDevices utils datasets methods
# [8] base
#
# other attached packages:
# [1] readr_1.3.1 Matrix_1.2-15
#
# loaded via a namespace (and not attached):
# [1] Rcpp_<IP_ADDRESS> knitr_1.20 whisker_0.3-2 magrittr_1.5
# [5] workflowr_1.6.2 hms_0.4.2 lattice_0.20-38 R6_2.3.0
# [9] rlang_0.4.10 fansi_0.4.0 stringr_1.3.1 grid_3.5.1
# [13] utf8_1.1.4 git2r_0.26.1 ellipsis_<IP_ADDRESS> htmltools_0.3.6
# [17] yaml_2.2.0 rprojroot_1.3-2 digest_0.6.18 lifecycle_1.0.0
# [21] tibble_3.1.0 crayon_1.3.4 later_0.7.5 vctrs_0.3.6
# [25] promises_1.0.1 fs_1.3.1 glue_1.4.2 evaluate_0.12
# [29] rmarkdown_1.10 stringi_1.2.4 pillar_1.5.0 compiler_3.5.1
# [33] backports_1.1.2 httpuv_1.4.5 pkgconfig_2.0.2


SiameseX
Result
Clone Search Results
Back
Back
Founds:
results
Expand
Collapse
No result found
Create new search


This is an example client to demo the sandboxed compiling.
This is an example client to demo the sandboxed compiling for file in server.
This is an example client to demo the sandboxed compiling for file in server with array stdin.
Output appears here


Falls City Journal | Obituaries
Bonnie L. Miller, 85, of Hiawatha, KS (formerly of Falls City), passed away March 9, 2013 at Hiawatha. She was born at Hubbell, NE to the late William and .
http://www.fcjournal.net/index.php?option=com_content&view=category&layout=blog&id=83&Itemid=146
Falls City, Nebraska City Information - ePodunk
Top. Obituaries. Check daily newspapers in or near Falls City · Search obituaries in Nebraska · Recent death notices - selected NE .
http://www.epodunk.com/cgi-bin/genInfo.php?locIndex=27374
Falls City couple says it's love; state says it's rape : The Lincoln ...
Jul 29, 2005 . FALLS CITY He notices the bulge in her belly. . Nebraska Attorney General Jon Bruning says at a press conference at the Capitol in Lincoln .
http://journalstar.com/news/falls-city-couple-says-it-s-love-state-says-it/article_28bc645d-fe38-5727-892d-a8cc7fde15f8.html
Falls City Journal - Falls City, NE - Newspaper | Facebook
Falls City Journal, Falls City, NE. 181 likes · 3 talking about this · 11 were here. . Address. 1810 Harlan St; Falls City, NE 68355-2126. Phone,<PHONE_NUMBER> .
http://www.facebook.com/pages/Falls-City-Journal/111164548946904
View Here the Falls City Journal! - City of Falls City, Nebraska
Falls City Journal/July 23, 2010 The Falls City Journal announces the launch of its website. fcjournal.net features rich content and local news, sports, obituaries, .
http://www.fallscitynebraska.org/news-announcements/falls-city-journal-website-up-running/
Falls City Obituaries | Obituaries in Falls City, NE - YP.com
Results 1 - 19 of 19 . 19 listings of Funeral Directors in Falls City on YP.com. Find reviews, directions & phone numbers for the best obituaries in Falls City, NE.
http://www.yellowpages.com/falls-city-ne/obituaries


A JavaBean object needn't to implement all setters but how to make it in a UJO object?
The read-only solution:
The next solution uses an writing LOCK property. In case the UJO initialization is finished, switch on the write lock flag. The lock throws an UnsupportedOperationException in case, you try to write a value by an Ujo API. See the next sample:package org; import org.ujorm.*; public class PersonRO extends org.ujorm.implementation.map.MapUjoExt<PersonRO> { public static final Key<PersonRO,Integer> ID = newKey(); public static final Key<PersonRO,String> NAME = newKey(); public static final Key<PersonRO,Boolean> LOCK = newKey(); public PersonRO(Integer id, String name) { set(ID, id); set(NAME, name); set(LOCK, true); } @Override public void writeValue(Key property, Object value) { if (get(LOCK)) { throw new UnsupportedOperationException("Property is read-only: " + property); } else { super.writeValue(property, value); } } }
About Author:
- You can write questions or other messages to me by a blog http://ujorm.blogspot.com/.
- A contact e-mail<EMAIL_ADDRESS>PPone(c) 2007-2009