In this project, you'll use generative adversarial networks to generate new images of faces.
You'll be using two datasets in this project:
Since the celebA dataset is complex and you're doing GANs in a project for the first time, we want you to test your neural network on MNIST before CelebA. Running the GANs on MNIST will allow you to see how well your model trains sooner.
If you're using FloydHub, set data_dir
to "/input" and use the FloydHub data ID "R5KrjnANiKVhLWAkpXhNBe".
data_dir = './data'
# FloydHub - Use with data ID "R5KrjnANiKVhLWAkpXhNBe"
#data_dir = '/input'
"""
DON'T MODIFY ANYTHING IN THIS CELL
"""
import helper
helper.download_extract('mnist', data_dir)
helper.download_extract('celeba', data_dir)
show_n_images = 25
"""
DON'T MODIFY ANYTHING IN THIS CELL
"""
%matplotlib inline
import os
from glob import glob
from matplotlib import pyplot
mnist_images = helper.get_batch(glob(os.path.join(data_dir, 'mnist/*.jpg'))[:show_n_images], 28, 28, 'L')
pyplot.imshow(helper.images_square_grid(mnist_images, 'L'), cmap='gray')
The CelebFaces Attributes Dataset (CelebA) dataset contains over 200,000 celebrity images with annotations. Since you're going to be generating faces, you won't need the annotations. You can view the first number of examples by changing show_n_images
.
show_n_images = 25
"""
DON'T MODIFY ANYTHING IN THIS CELL
"""
mnist_images = helper.get_batch(glob(os.path.join(data_dir, 'img_align_celeba/*.jpg'))[:show_n_images], 28, 28, 'RGB')
pyplot.imshow(helper.images_square_grid(mnist_images, 'RGB'))
Since the project's main focus is on building the GANs, we'll preprocess the data for you. The values of the MNIST and CelebA dataset will be in the range of -0.5 to 0.5 of 28x28 dimensional images. The CelebA images will be cropped to remove parts of the image that don't include a face, then resized down to 28x28.

You'll build the components necessary to build a GANs by implementing the following functions below:
model_inputs
discriminator
generator
model_loss
model_opt
train
This will check to make sure you have the correct version of TensorFlow and access to a GPU
"""
DON'T MODIFY ANYTHING IN THIS CELL
"""
from distutils.version import LooseVersion
import warnings
import tensorflow as tf
# Check TensorFlow Version
assert LooseVersion(tf.__version__) >= LooseVersion('1.0'), 'Please use TensorFlow version 1.0 or newer. You are using {}'.format(tf.__version__)
print('TensorFlow Version: {}'.format(tf.__version__))
# Check for a GPU
if not tf.test.gpu_device_name():
warnings.warn('No GPU found. Please use a GPU to train your neural network.')
else:
print('Default GPU Device: {}'.format(tf.test.gpu_device_name()))
Implement the model_inputs
function to create TF Placeholders for the Neural Network. It should create the following placeholders:
image_width
, image_height
, and image_channels
.z_dim
.Return the placeholders in the following the tuple (tensor of real input images, tensor of z data)
import problem_unittests as tests
def model_inputs(image_width, image_height, image_channels, z_dim):
"""
Create the model inputs
:param image_width: The input image width
:param image_height: The input image height
:param image_channels: The number of image channels
:param z_dim: The dimension of Z
:return: Tuple of (tensor of real input images, tensor of z data, learning rate)
"""
placeholder_images = tf.placeholder(tf.float32, (None, image_width, image_height, image_channels))
placeholder_z_data = tf.placeholder(tf.float32, (None, z_dim))
placeholder_learning_rate = tf.placeholder(tf.float32)
return placeholder_images, placeholder_z_data, placeholder_learning_rate
"""
DON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE
"""
tests.test_model_inputs(model_inputs)
Implement discriminator
to create a discriminator neural network that discriminates on images
. This function should be able to reuse the variables in the neural network. Use tf.variable_scope
with a scope name of "discriminator" to allow the variables to be reused. The function should return a tuple of (tensor output of the discriminator, tensor logits of the discriminator).
def discriminator(images, reuse=False):
"""
Create the discriminator network
:param images: Tensor of input image(s)
:param reuse: Boolean if the weights should be reused
:return: Tuple of (tensor output of the discriminator, tensor logits of the discriminator)
"""
alpha = 0.2
with tf.variable_scope('discriminator', reuse=reuse):
# Input layer is 28x28x3
x1 = tf.layers.conv2d(images, 64, 5, strides=2, padding='same')
x1 = tf.maximum(alpha * x1, x1)
# 14x14x64
x2 = tf.layers.conv2d(x1, 128, 5, strides=2, padding='same')
x2 = tf.layers.batch_normalization(x2, training=True)
x2 = tf.maximum(alpha * x2, x2)
# 7x7x128
x3 = tf.layers.conv2d(x2, 256, 5, strides=2, padding='valid')
x3 = tf.layers.batch_normalization(x3, training=True)
x3 = tf.maximum(alpha * x3, x3)
# 2x2x256
# Flatten it
flat = tf.contrib.layers.flatten(x3)
logits = tf.layers.dense(flat, 1)
out = tf.sigmoid(logits)
return out, logits
"""
DON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE
"""
tests.test_discriminator(discriminator, tf)
Implement generator
to generate an image using z
. This function should be able to reuse the variables in the neural network. Use tf.variable_scope
with a scope name of "generator" to allow the variables to be reused. The function should return the generated 28 x 28 x out_channel_dim
images.
def generator(z, out_channel_dim, is_train=True):
"""
Create the generator network
:param z: Input z
:param out_channel_dim: The number of channels in the output image
:param is_train: Boolean if generator is being used for training
:return: The tensor output of the generator
"""
alpha = 0.2
reuse = not is_train
with tf.variable_scope('generator', reuse=reuse):
# First fully connected layer
x1 = tf.layers.dense(z, 2*2*512)
# Reshape it to start the convolutional stack
x1 = tf.reshape(x1, (-1, 2, 2, 512))
x1 = tf.layers.batch_normalization(x1, training=is_train)
x1 = tf.maximum(alpha * x1, x1)
# 2x2x512 now
x2 = tf.layers.conv2d_transpose(x1, 256, 5, strides=2, padding='valid')
x2 = tf.layers.batch_normalization(x2, training=is_train)
x2 = tf.maximum(alpha * x2, x2)
# 7x7x256 now
x3 = tf.layers.conv2d_transpose(x2, 128, 5, strides=2, padding='same')
x3 = tf.layers.batch_normalization(x3, training=is_train)
x3 = tf.maximum(alpha * x3, x3)
# 14x14x128 now
# Output layer
logits = tf.layers.conv2d_transpose(x3, out_channel_dim, 5, strides=2, padding='same')
# 28x28xout_channel_dim now
out = tf.tanh(logits)
return out
"""
DON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE
"""
tests.test_generator(generator, tf)
Implement model_loss
to build the GANs for training and calculate the loss. The function should return a tuple of (discriminator loss, generator loss). Use the following functions you implemented:
discriminator(images, reuse=False)
generator(z, out_channel_dim, is_train=True)
def model_loss(input_real, input_z, out_channel_dim):
"""
Get the loss for the discriminator and generator
:param input_real: Images from the real dataset
:param input_z: Z input
:param out_channel_dim: The number of channels in the output image
:return: A tuple of (discriminator loss, generator loss)
"""
g_model = generator(input_z, out_channel_dim)
d_model_real, d_logits_real = discriminator(input_real)
d_model_fake, d_logits_fake = discriminator(g_model, reuse=True)
d_loss_real = tf.reduce_mean(
tf.nn.sigmoid_cross_entropy_with_logits(logits=d_logits_real, labels=tf.ones_like(d_model_real)))
d_loss_fake = tf.reduce_mean(
tf.nn.sigmoid_cross_entropy_with_logits(logits=d_logits_fake, labels=tf.zeros_like(d_model_fake)))
g_loss = tf.reduce_mean(
tf.nn.sigmoid_cross_entropy_with_logits(logits=d_logits_fake, labels=tf.ones_like(d_model_fake)))
d_loss = d_loss_real + d_loss_fake
return d_loss, g_loss
"""
DON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE
"""
tests.test_model_loss(model_loss)
Implement model_opt
to create the optimization operations for the GANs. Use tf.trainable_variables
to get all the trainable variables. Filter the variables with names that are in the discriminator and generator scope names. The function should return a tuple of (discriminator training operation, generator training operation).
def model_opt(d_loss, g_loss, learning_rate, beta1):
"""
Get optimization operations
:param d_loss: Discriminator loss Tensor
:param g_loss: Generator loss Tensor
:param learning_rate: Learning Rate Placeholder
:param beta1: The exponential decay rate for the 1st moment in the optimizer
:return: A tuple of (discriminator training operation, generator training operation)
"""
# Get weights and bias to update
t_vars = tf.trainable_variables()
d_vars = [var for var in t_vars if var.name.startswith('discriminator')]
g_vars = [var for var in t_vars if var.name.startswith('generator')]
# Optimize
with tf.control_dependencies(tf.get_collection(tf.GraphKeys.UPDATE_OPS)):
d_train_opt = tf.train.AdamOptimizer(learning_rate, beta1=beta1).minimize(d_loss, var_list=d_vars)
g_train_opt = tf.train.AdamOptimizer(learning_rate, beta1=beta1).minimize(g_loss, var_list=g_vars)
return d_train_opt, g_train_opt
"""
DON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE
"""
tests.test_model_opt(model_opt, tf)
"""
DON'T MODIFY ANYTHING IN THIS CELL
"""
import numpy as np
def show_generator_output(sess, n_images, input_z, out_channel_dim, image_mode):
"""
Show example output for the generator
:param sess: TensorFlow session
:param n_images: Number of Images to display
:param input_z: Input Z Tensor
:param out_channel_dim: The number of channels in the output image
:param image_mode: The mode to use for images ("RGB" or "L")
"""
cmap = None if image_mode == 'RGB' else 'gray'
z_dim = input_z.get_shape().as_list()[-1]
example_z = np.random.uniform(-1, 1, size=[n_images, z_dim])
samples = sess.run(
generator(input_z, out_channel_dim, False),
feed_dict={input_z: example_z})
images_grid = helper.images_square_grid(samples, image_mode)
pyplot.imshow(images_grid, cmap=cmap)
pyplot.show()
Implement train
to build and train the GANs. Use the following functions you implemented:
model_inputs(image_width, image_height, image_channels, z_dim)
model_loss(input_real, input_z, out_channel_dim)
model_opt(d_loss, g_loss, learning_rate, beta1)
Use the show_generator_output
to show generator
output while you train. Running show_generator_output
for every batch will drastically increase training time and increase the size of the notebook. It's recommended to print the generator
output every 100 batches.
train_show_every = 100
train_print_every = 10
def train(epoch_count, batch_size, z_dim, learning_rate, beta1, get_batches, data_shape, data_image_mode):
"""
Train the GAN
:param epoch_count: Number of epochs
:param batch_size: Batch Size
:param z_dim: Z dimension
:param learning_rate: Learning Rate
:param beta1: The exponential decay rate for the 1st moment in the optimizer
:param get_batches: Function to get batches
:param data_shape: Shape of the data
:param data_image_mode: The image mode to use for images ("RGB" or "L")
"""
image_width = data_shape[1]
image_height = data_shape[2]
image_channels = data_shape[3]
steps = 0
input_real, input_z, lr = model_inputs(image_width, image_height, image_channels, z_dim)
d_loss, g_loss = model_loss(input_real, input_z, image_channels)
d_train_opt, g_train_opt = model_opt(d_loss, g_loss, lr, beta1)
with tf.Session() as sess:
sess.run(tf.global_variables_initializer())
for epoch_i in range(epoch_count):
for batch_images in get_batches(batch_size):
steps += 1
# Rescale to [-1; 1] for tanh.
batch_images = batch_images * 2
# Sample random noise for G
batch_z = np.random.uniform(-1, 1, size=(batch_size, z_dim))
_ = sess.run(d_train_opt, feed_dict={input_real: batch_images, input_z: batch_z, lr: learning_rate})
_ = sess.run(g_train_opt, feed_dict={input_z: batch_z, input_real: batch_images, lr: learning_rate})
if steps % train_print_every == 0:
train_loss_d = d_loss.eval({input_z: batch_z, input_real: batch_images})
train_loss_g = g_loss.eval({input_z: batch_z})
print("Discriminator Loss: {:.4f}...".format(train_loss_d),
"Generator Loss: {:.4f}".format(train_loss_g))
if steps % train_show_every == 0:
show_generator_output(sess, 25, input_z, image_channels, data_image_mode)
Test your GANs architecture on MNIST. After 2 epochs, the GANs should be able to generate images that look like handwritten digits. Make sure the loss of the generator is lower than the loss of the discriminator or close to 0.
batch_size = 32
z_dim = 100
learning_rate = 0.0002
beta1 = 0.5
"""
DON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE
"""
epochs = 2
mnist_dataset = helper.Dataset('mnist', glob(os.path.join(data_dir, 'mnist/*.jpg')))
with tf.Graph().as_default():
train(epochs, batch_size, z_dim, learning_rate, beta1, mnist_dataset.get_batches,
mnist_dataset.shape, mnist_dataset.image_mode)
Run your GANs on CelebA. It will take around 20 minutes on the average GPU to run one epoch. You can run the whole epoch or stop when it starts to generate realistic faces.
batch_size = 32
z_dim = 100
learning_rate = 0.0002
beta1 = 0.5
"""
DON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE
"""
epochs = 1
celeba_dataset = helper.Dataset('celeba', glob(os.path.join(data_dir, 'img_align_celeba/*.jpg')))
with tf.Graph().as_default():
train(epochs, batch_size, z_dim, learning_rate, beta1, celeba_dataset.get_batches,
celeba_dataset.shape, celeba_dataset.image_mode)
When submitting this project, make sure to run all the cells before saving the notebook. Save the notebook file as "dlnd_face_generation.ipynb" and save it as a HTML file under "File" -> "Download as". Include the "helper.py" and "problem_unittests.py" files in your submission.


Welcome
This is the home page of Spotinfo.
Below you can find some basic account details such as your username and product type. Use the navigation buttons in the header to visit the different pages.
There are currently 2 main features:
Playlists:
- Provides a sortable table with playlists information for both owned and followed playlists.
- A barchart and overlaid line graph, showing the distribution of playlist sizes.
- Individual playlist pages with in-depth analysis.
Favourites:
- Provides a sortable table with your favourite songs and artists, over 3 differnt time periods.
- A network graph which shows the genre breakdown of all favourite artists.


---
layout: page-fullwidth
meta_teaser:
teaser: ""
header:
image: creo.jpg
background-color: "#262930"
caption: Getting Started with Creo
caption_url:
image:
thumb: creo.jpg
homepage:
caption:
caption_url: ""
categories:
- robotics
personhours: 1
title: Creo first experiences
rollcall: [Max]
---
{{ page.title }}
By {{ page.rollcall | array_to_sentence_string }}
Task: Utilize Creo to create better designs to print out for the robot
Our goal today is to use Creo; however, it is a new tool to us. We previously used SketchUp to do modelling of 3d-printed parts. SketchUp is easy to use, but limited in capabilities in comparison
to Creo, and does not make smooth circles/arcs. We may continue to use Sketchup for simpler items, but most parts we will print from now on will be designed in Creo. To learn Creo, we watched a
video tutorial on how to use Creo to model a relatively simple object: a whistle. We managed to make the whistle correctly on the first try, and 3-d printed it successfully. We are continuing to
watch Creo tutorials from time to time to learn more about this tool.
Reflections:
The greater amount of tools Creo includes compared to programs such as SketchUp gives us greater abilities in terms of making new parts and making them more efficient. The algorithm itself
was confusing to understand, but we found looking at videos where coders created complicated items like model elephants or CD players allows us to create our simpler designs bu using the
same told they did, just in a simpler fashion.


 Feel free to answer "NA" or provide more information at the end of the survey about your answers. Answers are confidential within COUCH.
Empty form submissions will not be considered for membership.


WITNESS LIST Appropriations Committee (Subcommittee on Return to Work Interim Charge #5) April 26, 2002-8:30A Interim Charge #5, Return to Work For: Clanton, Robert (JR3 Education Associates, LLC) Clemons, Robert (JR3 Education Associates, LLC) Freeman, Ray (JR3 Education Associates, LLC) Payne, Jim (JR3 Education Associates, LLC) On: Beckett, Sheila (Empolyees Retirement System) Biles, Susan (Comptroller of Public Accounts) Featherston, Pattie (Teacher Retirement System) Hale, Karen (Department of Mental Health and Mental Retardation) Hine, Jim (Department of Human Services) Johnson, Gary (Texas Department of Criminal Justice) Jung, Ronnie (Teacher Retirement System) Lehr, Mike (Texas Retired Teachers Association) Nail, William "Shack" (Employees Retirement System)


Toggle navigation
Welcome User
Logout
Dashboard
My Resources
Metrics
Metrics Monitoring
Live Sensor Cluster Data
FitBit
Plane
Car


---
layout: default
title: Support
description: A page describing support and partnerships for the iMED lab at the University of Pittsburgh.
keywords: panacis medical, syngrafii, national institutes of health, national institute of diabetes and digestive and kidney diseases, National Institute on Aging, Natural Sciences and Engineering Research Council of Canada, toronto rehab, holland bloorview kids rehabilitation hospital, ervin sejdic, iMED, University of Pittsburgh
---
Industrial Partnerships
| Company |
|
Research Area |
{% for partner in site.data.support.industry %}
| {{ partner.name }}{% if partner.location %} ({{ partner.location }}){% endif %} |
|
{{ partner.research-area }} |
{% endfor %}
Clinical Partnerships
| Institution |
|
Research Area |
{% for partner in site.data.support.clinical %}
| {{ partner.name }}{% if partner.location %} ({{ partner.location }}){% endif %} |
|
{{ partner.research-area }} |
{% endfor %}
Funding
| Institution |
|
{% for partner in site.data.support.funding %}
| {{ partner.name }}{% if partner.location %} ({{ partner.location }}){% endif %} |
|
{% endfor %}


You did not use any duplicate words in your sentense(s)! Wow!
You used duplicate words in your sentence(s). Here is your result:


Provides several novel exact hypothesis tests with minimal assumptions on the errors. The tests are exact, meaning that their p-values are correct for the given sample sizes (the p-values are not derived from asymptotic analysis). The test for stochastic inequality is for ordinal comparisons based on two independent samples and requires no assumptions on the errors. The other tests include tests for the mean and variance of a single sample and comparing means in independent samples. All these tests only require that the data has known bounds (such as percentages that lie in [0,100]. These bounds are part of the input.
| Version: | 0.2 |
| Depends: | R (≥ 3.2) |
| Imports: | stats |
| Suggests: | testthat |
| Published: | 2018-12-03 |
| Author: | Oliver Reiter [cre, aut], Karl Schlag [aut], Peter Saffert [ctb], Christian Pechhacker [ctb], Simona Jokubauskaite [ctb], Tautvilas Janusauskas [ctb] |
| Maintainer: | Oliver Reiter <oliver.reiter at snapdragon.cc> |
| BugReports: | https://github.com/zauster/npExact/issues |
| License: | GPL-2 |
| URL: | https://github.com/zauster/npExact |
| NeedsCompilation: | no |
| Materials: | README |
| CRAN checks: | npExact results |
| Reference manual: | npExact.pdf |
| Package source: | npExact_0.2.tar.gz |
| Windows binaries: | r-devel: npExact_0.2.zip, r-release: npExact_0.2.zip, r-oldrel: npExact_0.2.zip |
| OS X binaries: | r-release: npExact_0.2.tgz, r-oldrel: npExact_0.2.tgz |
Please use the canonical form https://CRAN.R-project.org/package=npExact to link to this page.


 And therefore the following links should help you situate yourself. We're pretty interested in anything and everything people can bring to Extflix, so to suggest features, view changes, gather support or even contribute your own scripts head to the following links.
- Changelog
- Wiki
- Issues Tracker
- Contributors


Microsoft Teams surpasses 20 million daily active users; rival Slack shares slip
(Reuters) - Microsoft Corp (MSFT.O) said on Tuesday its workplace messaging app, Teams, has more than 20 million daily active users, up from 13 million in July.
The software maker offers the app as part of some Office365 business packages, as well as a free version. Teams allows users to chat, share files, make calls and hold web video conferences.
Microsoft Teams, used by companies such as General Electric (GE.N) and SAP (SAPG.DE), competes with Slack Technologies Inc (WORK.N).
Slack, whose customers include Electronic Arts Inc (EA.O) and Nordstrom Inc (JWN.N), reported more than 10 million daily active users in the second quarter ended July 31.
Slack’s shares fell 8.4% following the news, to $21.18. They are down 45% from the close of their first day of trade in June.
Microsoft Teams also competes with Workplace by Facebook Inc (FB.O) and Cisco Systems Inc’s (CSCO.O) Webex Teams.


Singularity Flow¶
This section describes a suggested “best-practices” work-flow for building, running, and managing your containers.
There are generally two ways to get images. You either want to pull an image file as is, or (more likely) build your own custom image. We will start with talking about build and the many different use cases.
Building Images¶
If you read the quick start, you probably remember that building images from a Docker base does not require a Singularity recipe. However, if you do want to build and customize your image, you can create a Singularity recipe text file, which is a simple text file that describes how the container should be made.
The Singularity Flow¶
The diagram below is a visual depiction of how you can use Singularity to build images. The high level idea is that we have two environments:
a build environment (where you have sudo privileges) to test and build your container
a production environment where you run your container
Singularity production images are immutable. This is a feature added as of Singularity 2.4, and it ensures a higher level of reproducibility and verification of images. To read more about the details, check out the build docs. However, immutability is not so great when you are testing, debugging, or otherwise want to quickly change your image. We will proceed by describing a typical work-flow of developing first, building a final image, and using it in production.
1. Development Commands¶
If you want a writable image or folder for developing, you have two options:
build into a directory that has writable permissions using the
--sandbox
optionbuild into an ext3 image file, that has writable permissions with the
--writable
option
In both cases you will need to execute your container with the --writable
option at
runtime for your changes to be persistent.
Sandbox Folder¶
To build into a folder (we call this a “sandbox”) just ask for it:
$ sudo singularity build --sandbox ubuntu/ docker://ubuntu
Docker image path: index.docker.io/library/ubuntu:latest
Cache folder set to /root/.singularity/docker
Importing: base Singularity environment
Importing: /root/.singularity/docker/sha256:9fb6c798fa41e509b58bccc5c29654c3ff4648b608f5daa67c1aab6a7d02c118.tar.gz
Importing: /root/.singularity/docker/sha256:3b61febd4aefe982e0cb9c696d415137384d1a01052b50a85aae46439e15e49a.tar.gz
Importing: /root/.singularity/docker/sha256:9d99b9777eb02b8943c0e72d7a7baec5c782f8fd976825c9d3fb48b3101aacc2.tar.gz
Importing: /root/.singularity/docker/sha256:d010c8cf75d7eb5d2504d5ffa0d19696e8d745a457dd8d28ec6dd41d3763617e.tar.gz
Importing: /root/.singularity/docker/sha256:7fac07fb303e0589b9c23e6f49d5dc1ff9d6f3c8c88cabe768b430bdb47f03a9.tar.gz
Importing: /root/.singularity/metadata/sha256:22e289880847a9a2f32c62c237d2f7e3f4eae7259bf1d5c7ec7ffa19c1a483c8.tar.gz
Building image from sandbox: ubuntu/
Singularity container built: ubuntu/
We now have a folder with the entire ubuntu OS, plus some Singularity metadata, plopped in our present working directory.
$ tree -L 1 ubuntu
ubuntu
├── bin
├── boot
├── dev
├── environment -> .singularity.d/env/90-environment.sh
├── etc
├── home
├── lib
├── lib64
├── media
├── mnt
├── opt
├── proc
├── root
├── run
├── sbin
├── singularity -> .singularity.d/runscript
├── srv
├── sys
├── tmp
├── usr
└── var
And you can shell into it just like a normal container.
$ singularity shell ubuntu
Singularity: Invoking an interactive shell within container...
Singularity ubuntu:~/Desktop> touch /hello.txt
touch: cannot touch '/hello.txt': Permission denied
You can make changes to the container (assuming you have the proper
permissions to do so) but those changes will disappear as soon as you
exit. To make your changes persistent across sessions, use the --writable
option.
It’s also a good practice to shell into your container as root to
ensure you have permissions to write where you like.
$ sudo singularity shell ubuntu
Singularity: Invoking an interactive shell within container...
Singularity ubuntu:/home/vanessa/Desktop> touch /hello.txt
Writable Image¶
If you prefer to work with a writable image file rather than a
directory, you can perform a similar development build and specify the --writable
option. This will produce an image that is writable with an ext3 file
system. Unlike the sandbox, it is a single image file.
$ sudo singularity build --writable ubuntu.img docker://ubuntu
Docker image path: index.docker.io/library/ubuntu:latest
Cache folder set to /root/.singularity/docker
Importing: base Singularity environment
Importing: /root/.singularity/docker/sha256:9fb6c798fa41e509b58bccc5c29654c3ff4648b608f5daa67c1aab6a7d02c118.tar.gz
Importing: /root/.singularity/docker/sha256:3b61febd4aefe982e0cb9c696d415137384d1a01052b50a85aae46439e15e49a.tar.gz
Importing: /root/.singularity/docker/sha256:9d99b9777eb02b8943c0e72d7a7baec5c782f8fd976825c9d3fb48b3101aacc2.tar.gz
Importing: /root/.singularity/docker/sha256:d010c8cf75d7eb5d2504d5ffa0d19696e8d745a457dd8d28ec6dd41d3763617e.tar.gz
Importing: /root/.singularity/docker/sha256:7fac07fb303e0589b9c23e6f49d5dc1ff9d6f3c8c88cabe768b430bdb47f03a9.tar.gz
Importing: /root/.singularity/metadata/sha256:22e289880847a9a2f32c62c237d2f7e3f4eae7259bf1d5c7ec7ffa19c1a483c8.tar.gz
Building image from sandbox: /tmp/.singularity-build.VCHPpP
Creating empty Singularity writable container 130MB
Creating empty 162MiB image file: ubuntu.img
Formatting image with ext3 file system
Image is done: ubuntu.img
Building Singularity image...
Cleaning up...
Singularity container built: ubuntu.img
You can use this image with commands like shell
, exec
, run
, and if you want to
change the image you must use the --writable
flag. As before, it’s a good idea to
issue these commands as root to ensure you have the proper permissions
to write.
$ sudo singularity shell --writable ubuntu.img
Development Tip! When building containers, it often is the case that
you will have a lot of testing of installation commands, and if
building a production image, one error will stop the entire build.
If you interactively write the build recipe with one of these
writable containers, you can debug as you go, and then build the
production (squashfs) container without worrying that it will error
and need to be started again.
2. Production Commands¶
Let’s set the scene - we just finished building our perfect hello world
container. It does a fantastic hello-world analysis, and we have written
a paper on it! We now want to build an immutable container - meaning
that if someone obtained our container and tried to change it, they
could not. They could easily use the same recipe that you used (it is
provided as metadata inside the container), or convert your container to
one of the writable formats above using build
. So your work can still be
extended.
Recommended Production Build¶
What we want for production is a build into a squashfs image . Squashfs is a read only, and compressed filesystem, and well suited for confident archive and re-use of your hello-world. To build a production image, just remove the extra options:
sudo singularity build ubuntu.simg docker://ubuntu
Docker image path: index.docker.io/library/ubuntu:latest
Cache folder set to /root/.singularity/docker
Importing: base Singularity environment
Importing: /root/.singularity/docker/sha256:9fb6c798fa41e509b58bccc5c29654c3ff4648b608f5daa67c1aab6a7d02c118.tar.gz
Importing: /root/.singularity/docker/sha256:3b61febd4aefe982e0cb9c696d415137384d1a01052b50a85aae46439e15e49a.tar.gz
Importing: /root/.singularity/docker/sha256:9d99b9777eb02b8943c0e72d7a7baec5c782f8fd976825c9d3fb48b3101aacc2.tar.gz
Importing: /root/.singularity/docker/sha256:d010c8cf75d7eb5d2504d5ffa0d19696e8d745a457dd8d28ec6dd41d3763617e.tar.gz
Importing: /root/.singularity/docker/sha256:7fac07fb303e0589b9c23e6f49d5dc1ff9d6f3c8c88cabe768b430bdb47f03a9.tar.gz
Importing: /root/.singularity/metadata/sha256:22e289880847a9a2f32c62c237d2f7e3f4eae7259bf1d5c7ec7ffa19c1a483c8.tar.gz
Building Singularity image...
Cleaning up...
Singularity container built: ubuntu.simg
Production Build from Sandbox¶
We understand that it might be wanted to build a Singularity (squashfs) from a previous development image. While we advocate for the first approach, we support this use case. To do this, given our folder called “ubuntu/” we made above:
sudo singularity build ubuntu.simg ubuntu/
It could be the case that a cluster maintains a “working” base of container folders (with writable) and then builds and provides production containers to its users.
If you want to go through this entire process without having singularity installed locally, or without leaving your cluster, you can build images using Singularity Hub.


Full name is firstname + " " + lastname
If this two is checked then status will be ready!
Change Option 1
Change Option 2


About Me
I am a cyber-nerd from Berlin who absolutely loves technology.
I am also a coder, developer, hacker, blogger, reader, writer, thinker, entrepreneur, gamer, music lover, teacher, motivator, nature admirer and coffee addict. Apart from a Bachelor’s degree in Computer Science and a couple certifications in the IT I’m a self taught Full Stack Web Developer and Mobile Applications Developer. I have been dabbling in Computer Science for the past 10 years, often experimenting, learning new things, building personal projects and so on. My passion drives me to stay updated with the latest trends in the field of cyber, web and information technology. I endorse the Open-Source community and do my best to contribute towards it. I am looking forward to getting a Masters Degree in Computer Science to further enhance my knowledge and boost my career. My goal is to meet and work with a team of like-minded people where I can ideate freely and use my expertise to achieve excellence or build something truly remarkable.
I am available as a full-time web developer and would love to take up challenging projects. If you would like to talk about a project, opportunity, consult about something or would simply like to chat, feel free to leave a message. I promise I don't bite :)
My Portfolio
Project 1
Short project description goes here...
Project 2
Short project description goes here...
Project 3
Short project description goes here...
Project 4
Short project description goes here...
Project 5
Short project description goes here...
Project 6
Short project description goes here...


Dear Beloveth. I am Mrs. Fatima Rasheed Khalifa a widow to Late Sheik Mohammed Rasheed Khalifa am 64years old . Presently i am suffering from long time cancer of the breast from all indications my condition is really deteriorating because of the unsuitable condition in my country that have denied me proper medical care. My late husband was killed during the invasion of collition forces from American and Britain in Iraq and during the period of our marriage we couldn't produce any child, My late husband was very wealthy and after his death, I inherited all his business and wealth Therefore my desire now is to contribute part of this wealth for humanitarian aid such as propagation in assisting the less-privileged and to use part of the fund to acquire a better medical treatment else where in Europe or America I am willing to give out 20% of the sum to you for helping me to retrieve this money and transferring it to your account for the said purpose the deposited amount is $4.5 million united states dollars. Please I want you to note that this fund is lying in a Security Company.For that i have also written to a lawyer who will file application for the retrieving of the money on your name as the beneficiary, only if you promise to use this funds judiciary for the said purpose. Yours regards Mrs Fatima Rasheed


{% extends "includes/layout.html" %} {% block pageTitle %} Temporarily down for maintenance - {{ serviceName }} {% endblock %} {% block content %}
We are currently performing system maintenance
We should be back online shortly.


The Haven provides us with a home
where we can share life’s ups and
downs with people facing the same
challenges, people who do understand
what it is like to have their
expectations up-ended, people who
have similar goals and values.
Basically, we want to stay in recovery, get
good grades, make some friends, have
a great time, and prove to ourselves
and the world that college life can be
better – all around – clean and sober.
The Haven sober living model is based
on industry leading best practices – in
other words, we go with what works.
Because there are so many students
out there just like us, The Haven is
spreading to campuses all across
America. What this means is that by
signing up and engaging in this
experience, you’re instantly part of a
nationwide network. So you’ll find
people whom you have plenty in
common with wherever you go. We’d
call it a movement, but we’re keeping it
a little more low key than that – for
now, that is.
Here’s what we’ve been hearing from
college students in recovery:
You are NOT alone.
The Haven has other students who feel
just like you do and are facing the
same challenges, and at The Haven we
provide 24/7 support-- Live-in House
Managers who understand addiction
and recovery (and who are in recovery
themselves) and a Recovery Coach
who will help get you through.
From Day 1 you will belong to a
peer led community of caring,
compassionate individuals who
understand your daily challenges,
feelings, etc., and will celebrate
your successes and victories as well.
The Haven balances structure with the
need for freedom in the college
experience. Every student develops
an individualized plan to manage their
academics, social life, and recovery life
-- and works with the Haven’s
Recovery Coach on a weekly basis to
stay on track.
We get it. Recovery is a “we” program.
“WE” do this together. We understand
how very tricky it can be, and
sometimes difficult to choose not to
partake in some of the same activities
as your classmates. The Haven gives
students in recovery a way to connect
with their school and their classmates,
and it will afford them the necessary
tools to remain clean and sober.
Well, for one thing, you’ll remember it.
In many respects it will look almost
exactly like life before you lived at The
Haven: going to class, laundry at
midnight, hanging out with friends
(putting
off studying), and generally
just being a student. The bad news is
you don’t get passes for coursework or
finals. The good news is that a lot of
smart, caring people (including lots of
students in recovery,) have worked
together to create a
program that will
make your recovery life a lot easier,
things like:
To be a part of it, we all gotta do our
part. So what are your responsibilities?

Well, first you gotta think you’ve got a
problem. And then together, we move
forward from there.
If you think the Haven is for you, here’s
what you do to apply for admission:


Survey Questions
About You
Name (Required)
Link to Photo Image (Required)
Question 1
Life is more than a series of ones and zeroes.
Question 2
I think, therefore I am.
Question 3
I dreamt I was a butterfly.
Question 4
No snowflake ever falls in the wrong place.
Question 5
Death is whimsical today.
Question 6
One cannot survive on strength alone.
Question 7
Justice is defined by the hand that claims it.
Question 8
To know yourself is to be at peace.
Question 9
Do not be discouraged, everyone begins in ignorance.
Question 10
In anger, you defeat only yourself.


--- layout: post title: 'Observer Design Pattern' subtitle: 'All you need to know about the Observer Design Pattern.' date: 2019-12-14 10:30:23 +0100 categories: Software Development Design Pattern background: '/img/posts/observer-pattern/UML.png' ---
In today’s episode of Software Design Patterns you will learn everything about the Observer Design Pattern. The Observer Pattern is pretty common and widely used. Compared to the already covered creational design patterns like Singleton and Factory Method the Observer is a behavioral pattern.
All the examples, source code and unit tests are in this GitHub repository.
This Blog post and the code example is strongly inspired by the Microsoft's definition and implementation.
The Gang-of-Four [1] reference book ("Design Patterns. Elements of Reusable Object-Oriented Software") describes the intent of the Observer Pattern as the following.
Define a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically.
Basically you have an observable object (also often named subject) which holds a list of observers. This observable notifies all observers when a state changes. This is archived by calling one of their methods which is often called Notify() or OnNext(). In my example I have a list of newspaper which are subscribed to a news agency - called news handler. After the news handler puts out new news every subscribed newspaper will get notified. In addition to that every new newspaper will receive all existing news as well. This behavior depends on the use case - it could also be useful that you only want to receive brand-new news and not old ones.
In the picture below you find the Unified Modeling Language (UML) diagram.
Observer UMLIn the linked GitHub repository you will find the News class which represents the data model for news.
{% highlight csharp %} public class News { public int Id { get; set; } public string Headline { get; set; } public string Description { get; set; } public override string ToString() { return string.Join(";", new[] { Id.ToString(), Headline, Description }); } } {% endhighlight %}The NewsPaper class implements the IObserver interface, which provides all the structure for all observers.
{% highlight csharp %} public class NewsPaper : IObserver { public IList newsInfo = new List(); public string Name { get; } private IDisposable cancellation; public NewsPaper(string name) { if (String.IsNullOrEmpty(name)) { throw new ArgumentNullException("The observer must be assigned a name."); } Name = name; } public void Subscribe(NewsHandler provider) { cancellation = provider.Subscribe(this); } public void Unsubscribe() { cancellation.Dispose(); newsInfo.Clear(); } public void OnCompleted() { newsInfo.Clear(); } public void OnError(Exception error) { throw new NotImplementedException(); } public void OnNext(News value) { newsInfo.Add(value.ToString()); } } {% endhighlight %}The NewsHandler itself implements the IObservable interface, which holds the design for the observable.
{% highlight csharp %} public class NewsHandler : IObservable { private readonly IListThose interfaces are from directly the System name space in .Net.
In the test project you'll find test cases for subscribing, notifying and unsubscribing from observers.
{% highlight csharp %} public class ObserverPatternTest { [Fact] public void ShouldPublishToAllSubscribers() { var newsHandler = new NewsHandler(); var newsPaperOne = new NewsPaper("New York Times"); var newsPaperTwo = new NewsPaper("Washington Post"); var news = GenerateTestNews(); newsHandler.PostNews(news[0]); newsPaperOne.Subscribe(newsHandler); newsHandler.PostNews(news[1]); newsPaperTwo.Subscribe(newsHandler); newsHandler.PostNews(news[2]); newsPaperOne.newsInfo.Count.Should().Be(3); newsPaperTwo.newsInfo.Count.Should().Be(3); newsPaperOne.newsInfo[0].Should().Be(news[0].ToString()); newsPaperOne.newsInfo[1].Should().Be(news[1].ToString()); newsPaperOne.newsInfo[2].Should().Be(news[2].ToString()); newsPaperTwo.newsInfo[0].Should().Be(news[0].ToString()); newsPaperTwo.newsInfo[1].Should().Be(news[1].ToString()); newsPaperTwo.newsInfo[2].Should().Be(news[2].ToString()); } [Fact] public void ShouldResetAllNewsWhenUnsubscribed() { var newsHandler = new NewsHandler(); var newsPaperOne = new NewsPaper("New York Times"); var news = GenerateTestNews(); news.ToList().ForEach(newsHandler.PostNews); newsPaperOne.Subscribe(newsHandler); newsPaperOne.newsInfo.Count.Should().Be(3); newsPaperOne.Unsubscribe(); newsPaperOne.newsInfo.Should().BeEmpty(); } private static IList GenerateTestNews() { var ids = 1; return new Faker() .StrictMode(true) .RuleFor(n => n.Id, f => ids++) .RuleFor(n => n.Headline, f => f.Lorem.Sentence()) .RuleFor(n => n.Description, f => f.Lorem.Paragraph()) .Generate(3); } } {% endhighlight %}To make the tests more readable I am using FluentAsserstions. For generating test content I highly recommend using Bogus.
If you have any questions or comments feel free to leave them below.
That’s it. Happy coding as always :).
References
[1] –Design patterns, software engineering, object-oriented programming


State
TBD
Time
TBD
Exception
Test 1 (select node)
Test 2 (select state tab)
Test 3 (poll)
Test 4 (select console tab)
Test 5 (select state tab)
Test 6 (select new node)
Manual Test


[gecode-users] Nogoods limit
Kish Shen
kisshen at cisco.com
Fri Nov 22 19:28:07 CET 2013
Hi Christian,
I think I am using the predefined branchers, i.e. I just do:
branch(*solver, vars, varselect, valchoice);
I think this is using the pre-defined branchers?
and then I set up a search engine as I showed previously.
Thanks and cheers,
Kish
On 22/11/2013 14:04, Christian Schulte wrote:
> Hi Kish,
>
> Let me guess: you are not using the pre-defined branchers from Gecode or do
> you? If you use your own branchers you have to add support that actually
> generates the no-goods.
>
> Cheers
> Christian
>
> --
> Christian Schulte, Professor of Computer Science, KTH,
> www.ict.kth.se/~cschulte/
>
>
> -----Original Message-----
> From: users-bounces at gecode.org [mailto:users-bounces at gecode.org] On Behalf
> Of Kish Shen
> Sent: Friday, November 22, 2013 6:25 AM
> To: users at gecode.org
> Subject: [gecode-users] Nogoods limit
>
> Hi,
>
> I have now got restart search implemented, thanks to help from Christian. I
> finally decided to implement restart DFS as a separate search method in my
> interface, and only allow one solution in this case, because getting the
> previous solution posted as a no-goods looked quite difficult, and probably
> not a good idea for most search anyway.
>
> I ran some tests, and it seems that the restart with cutoff is working, but
> the no-goods limit is not:
>
> I tested the search with an N-Queens problem, using INT_VAR_NONE and
> INT_VAL_MIN for variable and value selection, and a constant cutoff.
> The idea here is that every single restart (without no-goods) should perform
> exactly the same search, so if the cutoff is set below the number of
> failures before the solution is found, then the search will not terminate.
> This is indeed the case, e.g. for N=8, with the cutoff set at 23, then the
> search does not terminate, but with cutoff=24, a solution is returned. Also,
> using a geometric cutoff, a solution is also found, even with a low initial
> cutoff. So this seems to show that the restart with cutoff is working as
> expected.
>
> However, it seems that I can't get the nogoods_limit to work -- using the
> same 8-Queens example, with a constant cutoff of 23, I expect that restarts
> with no-goods should be able to find the solution. However, even when I set
> the nogoods_limit very high (1000), the search does not terminate. So I
> assume this means my code for nogoods_limit is not working...
>
> I setup the restart DFS search engine as follows:
>
> sengine = new GecodeRBS<DFS>(solver, o);
>
> where o is a Search::Options, and has o.nogoods_limit set (I verified this
> by printing o.nogoods_limit just before calling the above).
>
> GecodeRBS is based on the code Chrisitan sent me:
>
> template<template<class> class E>
> class GecodeRBS : public GecodeEngineBase {
> protected:
> RBS<E,GecodeSpace> e;
>
> public:
> GecodeRBS(GecodeSpace* solver, const Search::Options& o) :
> e(solver,o) {}
> .....
> }
>
> (there might be typos: I typed the above in by hand, as cutting and pasting
> the actual code (in an VNC window) and my mailer running under Windows is a
> pain)
>
> I have not defined master() in GecodeSpace, as I think the default does what
> I need -- nogoods will be posted, so if nogood_limits is set, then nogoods
> should be collected and posted in the default master().
>
> So I expected that if o.nogoods_limit is set in my sengine setup code, then
> nogoods will be posted by master, and with the limit set to 1000, all
> nogoods in my 8-Queens examples should be collected and posted, so the
> search should terminate. So I don't know why the search is not terminating.
> Am I doing something wrong in my code, or is my understanding of the
> expected behaviour incorrect?
>
> I am using Gecode 4.2.0.
>
> Cheers,
>
> Kish
>
> _______________________________________________
> Gecode users mailing list
> users at gecode.org
> https://www.gecode.org/mailman/listinfo/gecode-users
>
More information about the users
mailing list


Hotcake doesn't force you to use its own implementation of class inheritance and definition. Maybe you already use something like Backbone or Ember or MooTools, and are not interested in yet another class handling library.
In that case, Hotcake is still prepared to work with your objects.
In this example, we use a Backbone Model and View to generate a counter that can be incremented via a button.
Once we hotload the classes again, the counter will increment by five, instead of one.
Bear in mind, hotloading doesn't re-instantiate your objects. All of your views, models, and collections are completely valid before and after hotloading. You can safely keep objects around for the entire life of the web application, through any number of hotloads, and be completely safe.


Call us in the first two weeks of February 2019 to get your 15% Discount. Please provide discount code Feb15Disc when you schedule or contact us for an appointment.
Providing efficient and friendly service since 2002. We handle financials so you don't have to.


{% include "partials/header.html" %}
{% block content %}{% endblock %}
{% include "partials/modals/data.html" %}
{% include "partials/modals/resources.html" %}
{% include "partials/modals/goal.html" %}
{% include "partials/modals/teams.html" %}
{% include "partials/footer.html" %}


Plotting FunctionsFunctions used to plot the results of the data analysis |
|
|---|---|
Plot Decision trees as gates |
|
Plots data as faceted scatterplot emulating the ouput of flow cytometry |
|
Functions to handle tree modelsDifferent functions that fit, visualize, output and print tree based models |
|
Consolidates the rules in a decision tree per cluster |
|
Prints concensus rules |
|
Gets the corresponding cluster for each terminl node in a classification tree |
|
Fits a classification tree on a Seurat object |
|
Converts a classification tree to a garnett output |
|
Fits a decision tree in one data set and tests the performance in another |
|
Marker Finding functionsFunctions with output consistent with Seurat equivalents, but allow using other classifiers (such as RangerDE). |
|
Gene expression markers for all identity classes |
|
Finds markers that are conserved between the groups |
|
Gene expression markers of identity classes |
|
Handle Gene namesUtility functions to find gene names and their common aliases (ie. ITGAX <> CD11c) |
|
Gets the official gene symbol for protein or gene aliases |
|
Gets the aliases for a gene names |
|
Queries gene symbols and returns if they are annotated as membrane-localized |
|
AntibodiesQuery antibody vendors for products that match your gene of interest. |
|
|
|
Query Antibodies from multiple vendors |
DatasetsSmall versions of sample datasets, they are commonly used to test the package functionality and have reproducible examples. |
|
A random subset of genes and cells from a 50:50 mixture of 293T:Jurkat cells |
|
A random subset of genes and cells from a 99:1 mixture of 293T:Jurkat cells |
|
Utilities |
|
Gets a data frame from a Seurat object |
|
Convert confusion matrices and tables to frequency matrices |
|
autoplot.table |
|
ranger_importances |


--- layout: default title: Make Your Company Data Driven has_jumbo: true --- Redash / docs Getting Started Chat Systems FAQ How to guides Integrations Using Redash Version Control Systems Help us improve Redash docs Contribute


Police parade Enugu pastor for rape, money rituals
by Raphael EdeRaphael Ede, Enugu
The Enugu State Police Command, on Tuesday, paraded the founder of the Christ Mercy Ministry, Ajuona Obukpa, in Nsukka Local Government Area of the state, Pastor Sunday Egbo, for alleged rape and involvement in money rituals.
Parading Egbo alongside 36 other suspects at the command headquarters, the state Commissioner of Police, Ahmed Abdur-rahman, said the pastor had on November 9, 2019, invited a female member of his church under the pretext of organising a crusade starting from 6pm.
According to the CP, the suspect asked the victim to come along with the picture of her sick brother for prayers.
Abdur-rahman stated, “On arrival, the pastor took her to his house and left while pretending to go and bring other people, who were supposed to participate in for the programme, but he returned around 11pm and dragged her into his room, brought out a magic stone and threatened to kill her if she raised the alarm.
“He ordered her to remove her clothes, but the victim refused and the pastor slapped her and tore her clothes and raped her.
“Egbo seized her pants, brassiere and brought out a small bottle and wanted to insert it in her private parts, but she struggled and ran naked to the door and shouted, which attracted neighbours, who invited the police to rescue her and arrest the pastor.”
Egbo confessed to the crime in an interview with journalists when he was asked to narrate why he was arrested by the police.
“I actually raped her in my house,” he stated.
Egbo said he approached a native doctor in Kogi State in his quest to be rich, adding that the native doctor gave him a small coffin and other items, and asked him to follow some instructions and he would become a millionaire.
He stated, “I paid the native doctor N200,000 to get the coffin and flute.
“But after two weeks, the money did not come as the native doctor had assured me.”
The CP warned criminals in the state to repent or move out of the state as the command would stop at nothing to fish them out.
He said the 36 other suspects paraded committed various offences ranging from conspiracy, cultism, armed robbery, unlawful possession of firearms, murder and vandalism.
Abdur-rahman said their arrests were made possible through intelligence-led policing measures in collaboration with local vigilante groups.
Copyright PUNCH.
All rights reserved. This material, and other digital content on this website, may not be reproduced, published, broadcast, rewritten or redistributed in whole or in part without prior express written permission from PUNCH.
Contact: theeditor@punchng.com


It seems to be really difficult for people in entertainment media to actually finish a bath or shower. The phone or doorbell rings, somebody bursts in on them, or they die.
In part, this is due to the Law of Conservation of Detail. The only reason to show somebody doing something as mundane as bathing is because something narratively important is going to happen during that bath — unless it's just for the Fanservice, or on occasion if it's a Slice of Life work.
This trope is usually played for laughs when it's not a Deadly Bath; a bath is supposed to be relaxing and being naked is embarrassing, which makes the addition of stress and/or visitors all the more annoying for the character (and therefore funnier for the audience).
This trope often coexists with the Candlelit Bath, since the extensive setup increases the comedy or drama value of ruining the whole thing.
Subtrope of the Bathtub Scene or Shower Scene. Super-Trope to the "Psycho" Shower Murder Parody.
Examples of fatal bathtime interruptions can go on Deadly Bath. The rest go here.
Examples:
- In Blattodea, Funny Foreigner Setsuna Dinoponera is first seen cheerfully bathing naked on a public park's fountain. Homeless roach-girl Chiyuri Haijima tries to talk her out of it to prevent any incidents with the police, and doesn't take kindly to Setsuna kicking her in response.
- Dirty Pair:
- In the 4th episode of the anime, a man named Romeo ends up having his shower invaded by Yuri who is trying to chase after a cat with his fiance Juliet unhappy about. The same situation happens again with Kei barging in this time and Juliet getting mad once again ready to divorce him.
- The movie Dirty Pair: Project Eden has a scene where Yuri and Kei are both having bubble baths and having their girl talk interrupted when Carson D. Carson falls into their tubs and then a monster attacks right after.
- Shizuka suffers from this constantly in Doraemon.
- Happens to Bulma in the 2nd chapter and episode of Dragon Ball.
- During chapter 42 of Kaguya-sama: Love Is War, Hayasaka tries to relax in the bath but Kaguya keeps on barging in to ask for help in setting up a Twitter account. As a result, Hayasaka spends most of the chapter in a Modesty Towel (in a rather rare example of the series using traditional fanservice).
- In Nana, Hachi has interrupted Nana's baths on a few times.
- Esmeraude has her bath interrupted at both the beginning and end of an episode of Sailor Moon R.
- Soul Eater:
- Blair's bath time is interrupted when Soul crashes through the window and lands in the tub face first right into her breasts during the first episode.
- Black Star interrupts Tsubaki while she is Skinny Dipping with his unsubtle and loud attempt at Outdoor Bath Peeping.
- In the first Tenchi Muyo! movie, Tenchi Muyo! In Love, Kiyone who is having a bath in an oil drum gets teleported out of it by Washu.
- The last episode of Zenderman has the resident Terrible Trio end up transporting into ancient Egypt in the bathroom of Cleopatra VII Philopator while she was having a bath in her bathing pool.
- Asterix at the Olympic Games: Chief Vitalstatistix is in his bath when a Roman centurion comes to call, leading to the page quote. Unwilling to let another one of his yearly baths be disturbed, he has his bearers put the tub on the shield and carry him before the centurion. The centurion thinks this a Gallic custom, so when Vitalstatistix comes to the camp, he finds the centurion ready to parley in his own tub.
- Subverted in one Judge Dredd story: two criminals break into an apartment, only to realize it's Dredd's, who's in the bath. He proceeds to neutralize them without getting out of the tub, because it's been far too long since he had one (as opposed to a shower).
- In Tintin, Captain Haddock once had to answer a phone call while in his bath. Hearing the ringing, he first put the shower on his ear like a receiver.
- In the first issue of Legends (DC), Ronnie Raymond is busy taking a shower when Martin Stein summons him to merge together to form Firestorm in order to deal with Brimstone.
- Blondie
- One of the strip's running gags involves Dagwood being interrupted while he's in the tub, usually by phone calls, repairmen, or neighbor kid Elmo.
- Not even Blondie herself is immune. After launching her catering business, an arrogant bridezilla charges into the Bumstead home to make changes to the reception menu while Blondie is naked and aghast in the tub.
- In Andy Capp, a neighbor of Andy's receives a phone call while he's in the bath that turns out to be a wrong number intended for Andy. He rushes over to Andy's house, wearing just a towel, to complain about it. "Tell him to call later," answers Andy, "I'm in my bath."
- An early Dennis the Menace (US) comic has Dennis introduce his mother to a friend of his while she's trying to take a bath. She's clearly not happy about it.
- Garfield
- Happens to Jon in the title panel of this Sunday comic.
Jon: Why is it the phone only rings when I'm in the bath?
- This strip has Jon in the tub with Garfield joining in to clean his rubber chicken, Odie jumping in, a mailman asking for him to sign a delivery and a paperboy throwing a newspaper at him.
- Happens to Jon in the title panel of this Sunday comic.
- Aladdin: While drowning, Aladdin rubs the lamp for help and thus disturbs the Genie as he's having a shower.
Genie: Never fails. You get in the bath, there's a rub at the lamp.
- La Ballade des Dalton: The Daltons (and Lucky Luke) are Crossing the Desert to kill Native-American shaman Snake Feather. When they reach his tepee and order him out, they hear Snake Feather complains that he's his bath... in the middle of a Thirsty Desert with no water for miles. He comes out wearing a towel. The shaman can apparently do the Rain Dance whenever he needs it, so water isn't a problem for him.
- Deconstructed in Recovery. Alan takes a shower at the hospital under supervision by a nurse. After lathering soap on dry skin, the nurse opens the shower curtain while he's drying off, reminding him to turn on the water.
- In The Savannah Reid Mysteries, Savannah's Candlelit Baths are supposed to be relaxing, a time when nothing disturbs her. Unfortunately, they frequently get interrupted by phone calls.
- Isaac Asimov's "The Traders": Limmar Ponyets is interrupted in his shower by a call from a fellow Trader bringing him an urgent assignment.
- This is an Implied Trope in Albert the Muffin-Maker from Mouse Math. Albert repeatedly borrows ingredients for muffins from his neighbor, Mrs. Nibble. The first time, she's happy to share. The second time, she's a bit less enthusiastic. When he comes over a third time, this time wanting to borrow both baking powder and salt, she's rather less happy, and also wearing a dripping bathrobe and shower cap with ducks on it.
- This is the basic premise of the Maisy picture book Maisy Takes a Bath and associated animated story titled simply "Bath." Maisy Mouse is trying to take a relaxing bubble bath, but keeps getting interrupted by her friend Tallulah ringing the doorbell because she wants to play. The story ends with them playing in the bath together.
- The picture book Five Minutes Peace, written and illustrated by Jill Murphy, is about an elephant mother who just wants five minutes peace from her children to take a bath, but keeps getting interrupted.
- Horatio Hornblower has one in Commodore. A sail is sighted while hes showering on deck, and the ensuing situation demands so much of his attention that he forgets hes nude. None of his subordinates comment on this, so its over an hour before he finally realizes he should put some clothes on.
- The 'Allo 'Allo! episode "The Nicked Knockwurst" opens with a scene with the main character taking a bath that is interrupted over and over again, much to his growing annoyance.
- Doctor Who: In "The Lodger", the Doctor, having been separated from the TARDIS and staying in a flat, is taking a shower when his flatmate Craig mentions through the door that he's going to see the mysterious, sinister upstairs neighbour that the Doctor is investigating. When the Doctor realizes what Craig's going to do, thereby putting himself in danger, he jumps out of the shower in a hurry and goes to help, wearing a towel and wielding... Craig's electric toothbrush, grabbed by accident instead of the sonic screwdriver.
- Eureka: The season four premiere has Fargo's shower get interrupted by his cellphone ringing. When he answers, he is abruptly dragged back in time to 1947.
- Friends : A whole episode is based on this in "The One Where Chandler Takes A Bath", where Chandler's baths are continuously interrupted to increasing comedic effect, resulting in a borderline Stateroom Sketch.
- An earlier episode sees Chandler and Monica sharing a bath in Chandler's apartment when Joey comes home and knocks on the bathroom door. Since Joey doesn't know about their Secret Relationship yet Monica has to hide under the water until he leaves.
- At the beginning of the Mann & Machine episode "Water, Water Everywhere," Mann tries to take a shower but is interrupted first by a phone call from Captain Claghorn and then by a reporter knocking at his door. Los Angeles is having a years-long drought, so Mann's water shuts off before he can finish, and he ends up having to rinse the soap out of his hair with bottled water.
- Star Trek: Voyager
- In the episode "Q2", Q intrudes on Captain Janeway enjoying a bath by teleporting into the tub, annoying her greatly.
- In "Drone", the holographic Doctor wakes up B'Elanna Torres with a Video Phone call, then after she goes into the shower and undresses, tries to continue the conversation via the Video Phone there. She throws her Modesty Towel over the screen.
- Star Trek: Enterprise. Captain Archer is taking a shower when the Artificial Gravity goes off-line.
- Taboo: Zilpha's bath is interrupted by her abusive husband when he brings news of a job offer in Australia. She's not impressed and asks him to leave.
- Zoey 101: In "Webcam", the girls get back at Logan for secretly taping them by staging a scene where they knock out Kazu. When Logan watches the scene on his computer, he retrieves Dean Rivers from his shower and takes him to the girls' dorm, only to see that everything's fine and that he just exposed his scheme. An infuriated Rivers then takes him to his office for interrupting his shower for nothing.
- In Dishonored, one of the women from the loyalist conspiracy takes a bath at one point. The door isn't locked, so if you so choose, you can just barge right in and endure her "What the Hell, Hero?" reaction.
- In Ozy and Millie, Millie's mother is relaxing in the tub, only for Millie to show up with an ominous warning about something she lost being a "non-poisonous variety."
- In Freefall, Florence has almost no luck taking a shower uninterrupted. At one point, she even goes so far as to put the Savage Chicken in lockdown just so she can get through one shower without interruptions.
- The Order of the Stick: The Oracle of the Sunken Valley apparently can't take a bath without being interrupted by a visit from adventurers.
Oracle: Jeez, I can peer into the murky depths of the future, yet I always seem to get interrupted during bath time.
- The website Television Without Pity had the often-used phrase "God is in the tub." This phrase was typically used in association with contestants on reality shows such as Survivor or The Amazing Race praying to God to help them in getting ahead on the show, the idea being that doing so is like interrupting your mother when she's trying to take a bath. Praying to God for a safe flight to the next leg of the race, or to calm your fears before a task? Okay. Praying that you beat the other teams? Not okay.
- Two Mickey MouseWorks shorts (both of which were repackaged as part of House of Mouse) used the trope of someone being interrupted while bathing.
- The short "Daisy's Big Sale" opens with Minnie coming out of her shower to answer a phone call from Daisy.
- In the short "Hydrosquirter", Ludwig Von Drake modifies his shower and accidentally turns it into a teleportation machine, resulting in an awkward situation when he hears a truck outside the tub and walks out to find himself in the middle of a busy street intersection.
Von Drake: I heard of home delivery, but I didn't know they drove right into your home. - Looney Tunes: Porky Pig has such a moment in Porky's Pooch.
- The Powerpuff Girls: In "Mo Job", Mojo Jojo has to get up from his bath to answer the door for Princess when she comes to his lair.
- The Simpsons: In "Bart Gets Famous", Bart wanders off from a field trip, and Principal Skinner calls Marge at home, causing her to run to the phone dripping wet in a towel. When she doesn't answer on time, he calls Homer at work, where, for some reason, he also runs for the phone after a shower.
Homer: You'll have to speak up, I'm wearing a towel.
- SpongeBob SquarePants: In "Have You Seen This Snail?", SpongeBob and Patrick walk in on Squidward taking a bath while searching for Gary, leading to the memetic scene of Squid screaming for ten seconds.
- Camp Lazlo: In "Hallowbeanies", Scoutmaster Lumpus' attempts to take a Candlelit Bath are continually interrupted by the Jelly Beans, who are trick-r-treating and keep walking in a circle and coming back to his door.
- On Hey Duggee, one of the Couch Gag openings has Happy in the bath, only to be asked "Isn't it time for.... DUGGEE!"
- In the She-Ra: Princess of Power episode "Flowers for Hordak", Mantenna, perpetual Butt-Monkey of the Evil Horde, is called into Hordak's throne room over an issue, as per the norm. This time, he was in the middle of a shower, so he's dripping wet and only in a shower cap and Modesty Towel. Hordak's more irritated over the fact he's dripping water on the floor, and sends him down the trapdoor, as always.
- In My Little Pony: Friendship Is Magic, Twilight summons Discord while he's showering, along with the shower. Though knowing him, he probably invoked it deliberately.
- Kaeloo: In one episode, Kaeloo is taking a shower, but Stumpy flushes all the toilets at once and the house runs out of water, so Kaeloo's shower is cut short.


future.apply: Apply Function to Elements in Parallel using Futures
Implementations of apply(), eapply(), lapply(), Map(), mapply(), replicate(), sapply(), tapply(), and vapply() that can be resolved using any future-supported backend, e.g. parallel on the local machine or distributed on a compute cluster. These future_*apply() functions come with the same pros and cons as the corresponding base-R *apply() functions but with the additional feature of being able to be processed via the future framework.
| Version: |
1.0.1 |
| Depends: |
R (≥ 3.2.0), future (≥ 1.9.0) |
| Imports: |
globals (≥ 0.12.1) |
| Suggests: |
datasets, stats, tools, listenv (≥ 0.7.0), R.rsp, markdown |
| Published: |
2018-08-26 |
| Author: |
Henrik Bengtsson [aut, cre, cph],
R Core Team [cph, ctb] |
| Maintainer: |
Henrik Bengtsson <henrikb at braju.com> |
| BugReports: |
https://github.com/HenrikBengtsson/future.apply/issues |
| License: |
GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] |
| URL: |
https://github.com/HenrikBengtsson/future.apply |
| NeedsCompilation: |
no |
| Materials: |
NEWS |
| CRAN checks: |
future.apply results |
Downloads:
Reverse dependencies:
| Reverse imports: |
BAMBI, drtmle, GSODR, kernelboot, origami, phylolm, R.filesets, robotstxt, RTransferEntropy, sperrorest |
| Reverse suggests: |
DeclareDesign, drake, future.BatchJobs, future.batchtools, future.callr, penaltyLearning |
Linking:
Please use the canonical form
https://CRAN.R-project.org/package=future.apply
to link to this page.


COSI A film review by James Berardinelli Copyright 1997 James Berardinelli
RATING (0 TO 10): 6.0 Alternative Scale: **1/2 out of ****
Australia, 1996 U.S. Release Date: 2/28/97 (limited); 4/4/97 (wide) Running Length: 1:40 MPAA Classification: R (Profanity, mature themes) Theatrical Aspect Ratio: 1.85:1
Cast: Ben Mendelsohn, Barry Otto, Toni Collette, Pamela Rabe, Jacki Weaver, David Wedham, Paul Chubb, Rachel Griffiths, Colin Friels, Aden Young, Colin Hay Director: Mark Joffe Producers: Richard Brennan, Timothy White Screenplay: Louis Nowra based on his play Cinematography: Ellery Ryan Music: Stephen Endelman U.S. Distributor: Miramax Films
A curious thing happened to COSI on its way to a United States release -- it got lost. Or at least temporarily misplaced. Miramax Films began showing trailers for this movie more than a year ago, but the opening date was repeatedly delayed until just about everyone had forgotten about it. Now, eleven months after it premiered in Australia, COSI is finally set to open. Unfortunately, it's not really worth the wait. The film is like a half-baked amalgamation of A MIDWINTER'S TALE and SHINE, and doesn't excel as either a comedy or a drama.
The story centers around Lewis (Ben Mendelsohn), a twenty-something Australian who has trouble holding down a job. His latest venture is to direct a play, an effort that is encouraged by his best friend (Aden Young) and his lover (Rachel Griffiths). Only he's not a very good director ("He couldn't direct a nymphomaniac to a stag night"), and this isn't an ordinary production. His task is to helm an offbeat adaptation of a Mozart opera, COSI FAN TUTTE, that will be performed by the patients at a psychiatric hospital. Following an audition process that isn't as funny or inventive as that from either A MIDWINTER'S TALE or WAITING FOR GUFFMAN, Lewis has his cast, which is comprised of the usual suspects. There's Roy (Barry Otto), a manic with a thirst for stage exposure; Julie (Toni Collette), a recovering drug addict; Ruth (Pamela Rabe), a painfully shy woman with suicidal tendencies; Cherry (Jacki Weaver), an aggressive and potentially-violent woman; and Henry (Paul Chubb), a failed lawyer.
The main theme relates to Lewis discovering meaning in his life through his interaction with the patients and how they, in turn, learn to respect and value themselves. While there's potential in that story, director Mark Joffe (THE EFFICIENCY EXPERT) paints everything with broad strokes. The characters are all types and their circumstances are predictable. The shallow script, adapted by Louis Nowra from his play, proceeds in a disappointingly straightforward fashion.
Because COSI's dramatic side is so weak, it's up to the comedy to sustain the film. However, while the movie delivers a few hearty laughs here and there, the humor is inconsistent. The most interesting aspect of the plot -- a subtext that asks questions about female fidelity (the theme of COSI FAN TUTTE) and male double standards -- is left largely unexplored. A feeble attempt is made to address these issues as they apply to Lewis' life, but the result isn't satisfying.
The cast is populated by recognizable faces from Australian cinema. Ben Mendelsohn (THE EFFICIENCY EXPERT) does an adequate job as Lewis. Even though he has the most screen time, his low-key performance allows him to be easily eclipsed. This tendency to fade into the background makes it difficult for us to get a handle on Lewis. On the other hand, Barry Otto (the father in STRICTLY BALLROOM) is anything but subdued. His overwrought turn as Roy allows us to better appreciate the nuances of Geoffrey Rush's interpretation of David Helfgott in SHINE. Meanwhile, Toni Collette (MURIEL'S WEDDING) is delightful, although underused. Two things that we learn about her in COSI are that she's a lot more svelte than MURIEL'S WEDDING led us to believe and she's got a great singing voice (her rendition of "Don't Dream It's Over" is used during the end credits). Rachel Griffiths (MURIEL'S WEDDING), Aden Young (HOTEL DE LOVE), Pamela Rabe (SIRENS), and Colin Friels (ANGEL BABY) all have significant supporting roles.
Despite its numerous shortcomings, COSI contains several magical moments. One occurs on a darkened stage when Lewis and Julie, their profiles silhouetted against a lighter background, tentatively kiss. Another happens late in the film, as Julie sings "Stand By Me" to an enraptured audience. There's also a lengthy post-credits sequence, which, in addition to offering one of the film's funniest gags, presents perhaps the strangest conclusion to a movie that I've ever witnessed. If you choose to see COSI, do not leave until the end credits are over.
When it comes to filmed versions of behind-the-scenes amateur theatrical productions, COSI is a weak entry. It's a good-natured film, I suppose, but its attempts to inspire often seem more manipulative than uplifting. Maybe the reason for Miramax's release delay is that, recognizing how mediocre COSI is, they hoped that, like an average wine, it might improve if it was left sitting on the shelf. Clearly, that hasn't happened.
- James Berardinelli e-mail<EMAIL_ADDRESS>ReelViews web site: http://www.cybernex.net/~berardin
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


Logistic Regression
1. Logistic Regression
In the logistic regression algorithm the probability, of a binary class, is calculated as
\[p(c=0|x)=\sigma\Big(\sum_i \omega_i x^i +b\Big)\]where $\sigma(x)$ is the sigmoid function
\[\sigma(z)=\frac{1}{1+e^{-z}}\]The sigmoid function approaches quickly one for large values of $z$ while it goes to zero for very negative values.
The predictor is obtained from
\[c=\text{argmax}_{c=0,1}p(c|x)\]The red dots in the picture above represent a few examples.
The logistic function is composed of a linear followed by a non-linear operation, given by the sigmoid function. This composed operation is usually represented in the diagram
where $x^i$ are the features of the datapoint $x$. The node (circle) represents the composition of a linear operation followed by a non-linear function. In more complex graphs, the sigmoid function’s output can become the input of an additional non-linear operation. This way, we can stack various non-linear operations, which give an increased level of complexity. This type of graph has the name of neural network.
In the multiclass case, the probabilities have instead the form
\[p(y^k|x)=\frac{e^{z^k(x)}}{Z(x)}\]where $z^k=-\sum_i\omega^k_i x^i-b^k$ and $Z(x)=\sum_l e^{z^l(x)}$ is a normalization. Diagrammatically this has the form
where the function
\[f(z)^k=\frac{e^{z^k}}{\sum_l e^{z^l}}\]is the softmax function. It provides with a non-linear operation after the linear transformation $z^k=-\omega^k_ix^i-b$. Since the softmax function is invariant under $z^k\rightarrow z^k+\lambda$, we can choose to fix $z^0$ to zero, which implies $\omega^0_i=0$ and $b^0=0$.
Given a dataset $S={(\vec{x}_0,y_0),(\vec{x}_1,y_1),\ldots (\vec{x}_N,y_N)}$ we determine the parameters $\omega$ and $b$ using maximum-likelihood estimation, that is, we minimize the loss function
\[\begin{equation*}\begin{split}\mathcal{L}=&-\frac{1}{N}\sum_{i=1}^N \ln p(y^i|\vec{x}_i)\\ =&\frac{1}{N}\sum_i \omega^i_jx^j+b^i+\ln Z(\vec{x}_i)\end{split}\end{equation*}\]One of the main advantages of using the logistic function is that it makes the loss function convex, which allows us to apply more robust optimization algorithms like the Newton-Raphson method. To see that the loss function is convex, lets for simplicity define $\omega^k\equiv(\omega^k_i,b^k)$ and $x\equiv(x^i,1)$. Calculating the derivatives of the loss function
\[\frac{\partial \mathcal{L}}{\partial \omega^{\mu}_{\nu}}=\langle \delta^k_{\mu}x^{\nu}\rangle_{y^k,x}-\langle x^{\nu}p_{\mu}(x)\rangle_{x}\]where $p_{\mu}(x)$ is the probability, $\delta$ is the Kroenecker delta function, and $\langle \rangle$ represents sample averages. And the second derivatives
\[\frac{\partial^2 \mathcal{L}}{\partial \omega^{\mu}_{\nu} \partial \omega^{\alpha}_{\beta}}=\langle x^{\nu}x^{\beta}\delta_{\mu\alpha}p_{\mu}(x) \rangle_x -\langle x^{\nu}x^{\beta}p_{\mu}(x)p_{\alpha}(x) \rangle_x\]To show this is a convex optimization problem, we build the quadratic polynomial in $\lambda^{\mu}_{\nu}$ at a point $x$,
\[\begin{equation*}\begin{split}&\sum_{\mu,\nu,\alpha,\beta}x^{\nu}x^{\beta}\delta_{\mu\alpha}p_{\mu}(x)\lambda^{\mu}_{\nu}\lambda^{\alpha}_{\beta}-x^{\nu}x^{\beta}p_{\mu}(x)p_{\alpha}(x)\lambda^{\mu}_{\nu}\lambda^{\alpha}_{\beta}=\\ &\sum_{\mu} p_{\mu}(x)(\lambda^{\mu}_{\nu}x^{\nu})^2-\Big(\sum_{\mu}p_{\mu}(x)\lambda^{\mu}_{\nu}x^{\nu}\Big)^2=\langle \lambda^2\rangle-\langle \lambda\rangle^2\geq 0\end{split}\end{equation*}\]Summing over $x$ we show that
\[\sum_{\mu,\nu,\alpha,\beta}\frac{\partial^2 \mathcal{L}}{\partial \omega^{\mu}_{\nu} \partial \omega^{\alpha}_{\beta}} \lambda^{\mu}_{\nu}\lambda^{\alpha}_{\beta}\geq 0\]2. Newton-Raphson method
The Newton-Raphson method provides with a second-order optimization algorithm. In essence it consists in solving iteratively a second-order expansion of the loss function. First, we Taylor expand the loss function to second order
\[\mathcal{L}=\mathcal{L}(\omega_0)+\frac{\partial \mathcal{L}}{\partial\omega_i}|_{\omega_0}\Delta\omega_i+\frac{1}{2}\frac{\partial^2 \mathcal{L}}{\partial\omega_i\partial\omega_j}|_{\omega_0}\Delta\omega_i\Delta\omega_j+\mathcal{O}(\Delta\omega^3)\]Then we solve for $\Delta\omega$
\[\Delta\omega=\text{argmin}\frac{\partial \mathcal{L}}{\partial\omega_i}|_{\omega_0}\Delta\omega_i+\frac{1}{2}\frac{\partial^2 \mathcal{L}}{\partial\omega_i\partial\omega_j}|_{\omega_0}\Delta\omega_i\Delta\omega_j\]that is,
\[\Delta\omega_i=-\sum_j\Big(\frac{\partial^2 \mathcal{L}}{\partial\omega_i\partial\omega_j}|_{\omega_0}\Big)^{-1}\frac{\partial \mathcal{L}}{\partial\omega_j}|_{\omega_0}\]The algorithm consists of updating the reference point $\omega_0$ as
\[\omega_0\rightarrow \omega_0+\Delta\omega\]and continuing iteratively by solving the derivatives on the new reference point. In the logistic regression case, the parameter $\omega_i$ is a matrix with components $\omega^k_i$. Determining the inverse of a $n\times n$ matrix is an order $\mathcal{O}(n^3)$ (with Gaussian elimination) process, while the matrix-vector multiplication operations are of order $\mathcal{O}(n^2)$. Therefore each step of the Newton-Raphson method is a $\mathcal{O}(n^3)$ process. Since $n=K(d+1)$ where $K$ is the number of classes and $d$ is the feature dimension, the Newton-Raphson is a fast algorithm provided both $K$ and $d$ are relatively small.
3. Decision Boundary
In a binary classification problem the decision boundary of the logistic regression is a hyperplane. This is because the threshold value $p(0|x)=0.5$ implies the linear constraint $\sum_i\omega_i x^i+b=0$. For more classes, the decision boundary corresponds to regions bounded by hyperplanes. For any two classes $c_1,c_2$ we determine a pseudo-boundary, that is, the hyperplane represented by the equation $p(c_1|x)=p(c_2|x)$. This gives
\[\text{hyperplane}_{c_1,c_2}:\;\sum_i(\omega^{c_1}_i-\omega^{c_2}_i)x^i+b^{c_1}-b^{c_2}=0\]For $N$ classes we have $N(N-1)/2$ hyperplanes. We can use these hyperplanes to determine the predicted class. For example, in two dimensions
We can show that the regions for the predicted classes are simply connected convex sets. Consider two points $x_1$ and $x_2$, both belonging to the same predicted class $k$. We construct the set
\[(1-\lambda)x_1+\lambda x_2,\;0\leq\lambda\leq 1\]Since $\sum_i\omega^k_ix^i_1+b^k\geq \sum_i\omega^{j}_i x^i_1+b^j,\;j\neq k$ and similarly for $x_2$, we must have
\[(1-\lambda)\sum_i\omega^k_ix^i_1+\lambda \sum_i\omega^k_ix^i_2+b^k\geq (1-\lambda)\sum_i\omega^j_ix^i_1+\lambda \sum_i\omega^j_ix^i_2 +b^j,\;j\neq k\]since $\lambda\geq 0$ and $1-\lambda\geq 0$. This means that all the points belonging to the set connecting $x_1$ and $x_2$ have the same class, which thus implies that the region with predicted class $k$ must be singly connected, and convex. For example, for the data above
4. Python Implementation
# class ProbSoftmax is the model
class ProbSoftmax:
def __init__(self,n_features,n_classes):
self.n_features=n_features
self.n_classes=n_classes
self.weight=np.random.normal(0,0.1,(n_classes,n_features))
self.weight[0]=0
def __call__(self,x):
wx=-np.dot(x,self.weight.T)
wx=np.exp(wx)
Z=wx.sum(1).reshape(-1,1)
return wx/Z
Optimizer class with backward and step methods:
# class logloss calculates the loss function and the Newton-Raphson step.
class logloss:
def __init__(self,model):
self.prob=model #model: ProbSoftmax object
self.delta_w=None
self.nf=model.n_features
self.nc=model.n_classes
def backward(self,x,y):
p=self.prob(x)
z=np.tensordot(x,y[:,1:]-p[:,1:],axes=[0,0])
z=z.reshape(-1,1)
z=z/x.shape[0]
return z
def back_square(self,x):
p=self.prob(x)
p=p[:,1:]
z=0
for a,b in zip(x,p):
idt=np.diag(b)
k=np.outer(a,a)
w=np.outer(b,b)
z+=np.tensordot(k,idt-w,axes=0)
z=np.transpose(z,(0,2,1,3))
z=z.reshape(z.shape[0],z.shape[1],z.shape[2]*z.shape[3])
z=z.reshape(z.shape[0]*z.shape[1],-1)
z=z/x.shape[0]
return z
def step(self):
self.prob.weight[1:,:]+=self.delta_w
def delta(self,x,y):
f=self.backward(x,y)
M=self.back_square(x)
M_inv=np.linalg.inv(M)
delta_w=-np.dot(M_inv,f)
delta_w=delta_w.reshape(self.nf,-1)
delta_w=delta_w.T
return delta_w
def __call__(self,x,y):
#y is hot encoded
p=self.prob(x)
p=p*y
p=p.sum(1)
self.delta_w=self.delta(x,y)
return -np.log(p).mean()
Training function:
def training(model,x,y,num_iter=10):
loss=logloss(model)
for i in range(num_iter):
L=loss(x,y) #when calling, the object calculates the derivatives and determines the Newton-Raphson step
loss.step() #it shifts w by delta_w
print("Loss=",L," iter:",i)


uBit.storage¶
Overview¶
MicroBitStorage
provides a simple way to store data on the micro:bit that persists
through power cycles. It currently takes the form of a key value store which contains
a number of key value pairs.
If a user wanted to determine if a micro:bit has just been flashed over USB they could simply write the following:
#include "MicroBit.h"
MicroBit uBit;
int main()
{
uBit.init();
KeyValuePair* firstTime = uBit.storage.get("boot");
int stored;
if(firstTime == NULL)
{
//this is the first boot after a flash. Store a value!
stored = 1;
uBit.storage.put("boot", (uint8_t *)&stored, sizeof(int));
uBit.display.scroll("Stored!");
}
else
{
//this is not the first boot, scroll our stored value.
memcpy(&stored, firstTime->value, sizeof(int));
delete firstTime;
uBit.display.scroll(stored);
}
}
What is flash memory?¶
The micro:bit has 256 kB flash memory and 16 kB random access memory (RAM). Flash memory is non-volatile, which essentially means that data is not forgotten when the device is powered off, this is the technology that many USB sticks use.
The alternative, Random Access Memory (also known as volatile memory), cannot be persisted through power cycling the device as its operation relies upon maintaining a constant supply of power.
Therefore, MicroBitStorage
utilises the non-volatile nature of flash memory, to
store its data. This class is utilised by the compass, accelerometer
and bleManager to improve the user experience by persisting calibration
and bonding data.
Operations¶
You can put()
, get()
and remove()
key value pairs from the store.
Key Value pairs have a fixed length key of 16 bytes
, and a fixed length value of
32 bytes
. This class only populates a single block (1024 bytes
) in its current state,
which means that 21 Key Value pairs can be stored.
Message Bus ID¶
None.
Message Bus Events¶
None.
API¶
Constructor¶
MicroBitStorage()¶
Description¶
Default constructor.
Creates an instance of MicroBitStorage which acts like a KeyValueStore that allows the retrieval, addition and deletion of KeyValuePairs.
writeBytes¶
int writeBytes( uint8_t * buffer, uint32_t address, int length)¶
Description¶
Writes the given number of bytes to the address specified.
Parameters¶
uint8_t *buffer - the data to write.uint32_taddress - the location in memory to write to.intlength - the number of bytes to write.
Note
currently not implemented.
flashPageErase¶
void flashPageErase( uint32_t * page_address)¶
Description¶
Method for erasing a page in flash.
page_address
Address of the first word in the page to be erased.
Parameters¶
uint32_t *page_address - Address of the first word in the page to be erased.
flashWordWrite¶
void flashWordWrite( uint32_t * address, uint32_t value)¶
Description¶
Method for writing a word of data in flash with a value.
address
Address of the word to change.
value
Value to be written to flash.
Parameters¶
uint32_t *address - Address of the word to change.uint32_tvalue - Value to be written to flash.
put¶
int put( const char * key, uint8_t * data, int dataSize)¶
Description¶
Places a given key, and it's corresponding value into flash at the earliest available point.
Parameters¶
const char *key - the unique name that should be used as an identifier for the given data. The key is presumed to be null terminated.uint8_t *data - a pointer to the beginning of the data to be persisted.intdataSize - the size of the data to be persisted
Returns¶
MICROBIT_OK on success, MICROBIT_INVALID_PARAMETER if the key or size is too large, MICROBIT_NO_RESOURCES if the storage page is full
int put( ManagedString key, uint8_t * data, int dataSize)¶
Description¶
Places a given key, and it's corresponding value into flash at the earliest available point.
Parameters¶
ManagedStringkey - the unique name that should be used as an identifier for the given data.uint8_t *data - a pointer to the beginning of the data to be persisted.intdataSize - the size of the data to be persisted
Returns¶
MICROBIT_OK on success, MICROBIT_INVALID_PARAMETER if the key or size is too large, MICROBIT_NO_RESOURCES if the storage page is full
get¶
KeyValuePair get( const char * key)¶
Description¶
Retreives a KeyValuePair identified by a given key.
Parameters¶
const char *key - the unique name used to identify a KeyValuePair in flash.
Returns¶
a pointer to a heap allocated KeyValuePair struct, this pointer will be NULL if the key was not found in storage.
Note
it is up to the user to free memory after use.
KeyValuePair get( ManagedString key)¶
Description¶
Retreives a KeyValuePair identified by a given key.
Parameters¶
ManagedStringkey - the unique name used to identify a KeyValuePair in flash.
Returns¶
a pointer to a heap allocated KeyValuePair struct, this pointer will be NULL if the key was not found in storage.
Note
it is up to the user to free memory after use.
remove¶
int remove( const char * key)¶
Description¶
Removes a KeyValuePair identified by a given key.
Parameters¶
const char *key - the unique name used to identify a KeyValuePair in flash.
Returns¶
MICROBIT_OK on success, or MICROBIT_NO_DATA if the given key was not found in flash.
int remove( ManagedString key)¶
Description¶
Removes a KeyValuePair identified by a given key.
Parameters¶
ManagedStringkey - the unique name used to identify a KeyValuePair in flash.
Returns¶
MICROBIT_OK on success, or MICROBIT_NO_DATA if the given key was not found in flash.
size¶
int size()¶
Description¶
The size of the flash based KeyValueStore .
Returns¶
the number of entries in the key value store


NYC Weekend Watch: Terrence Malick, Romanian Revolution, Patricia Mazuy & More
by Nick NewmanS ince any New York City cin ephile has a nearly suffocating wealth of theatrical options, we figured it’d be best to compile some of the more worthwhile repertory showings into one handy list. Displayed below are a few of the city’s most reliable theaters and links to screenings of their weekend offerings — films you’re not likely to see in a theater again anytime soon, and many of which are, also, on 35mm. If you have a chance to attend any of these, we’re of the mind that it’s time extremely well-spent.
Museum of the Moving Image
A major Terrence Malick retrospective has begun.
“No Joke: Absurd Comedy as Political Reality” ends with the staggering The Trial and Monsieur Verdoux.
Film Forum
Films on the Romanian revolution are showcased in a new series.
Ozu’s Tokyo Twilight screens in a restored version.
Films by George Roy Hill and Joseph Losey play this weekend.
Film at Lincoln Center
Widely underscreened in the U.S., French director Patricia Mazuy is the subject of a retrospective.
Museum of Modern Art
MoMA has reopened, and it is–I do not say this lightly–almost too much in one weekend. See for yourself.
Metrograph
A Noah Baumbach retrospective pairs his films with work by Peter Bogdanovich.
The Basquiat-led Downtown 81 continues.
Dead Man has late-night screenings, while Gremlins screens early.
Anthology
The long-suppressed Equation to an Unknown has a revival run.
Nitehawk
A print of the German feature Coming Out screens early.


By default a translucent image is generated from the drag target (for most browsers). A custom image can be used if desired.


COINS supports a wide range of optimizations such as SSA based optimizations and conventional optimizations based on data-flow analysis. These optimizations are selectable by the compiler optins. The backend process of COINS also has several basic optimization processes such as register allocation, jump optimization, constant foldings. These optimizations are always applied by default.
The relative execution times of the SPEC benchmarks are shown in Fig.12-1.
This figure shows the good performance of the backend optimizations.
The effects of SSA optimizations and some added optimizations are shown in Fig.12-2.
isort: insertion sort ssort: selection sort heap: heap sort shell: shell sort queen: 8-queen soukan: correlation coefficient komachi: "komachi" calculation prime: prime number matmult: matrix multiplication COINS 0: COINS C compiler, no optimization selected COINS 1: COINS C compiler, with compiler options -coins:ssa-opt=prun/divex/cse/cstp/hli/osr/hli/cstp/cpyp/preqp/cstp/rpe/dce/srd3 COINS 2: COINS C compiler, with compiler options -coins:ssa-opt=prun/divex/cse/cstp/hli/osr/hli/cstp/cpyp/preqp/cstp/rpe/dce/srd3, attach=coins.backend.sched.Schedule,schedule,pipelining,attach=Regromote,regpromote gcc O2: gcc compiler, with compiler options "-O2" gcc O3: gcc compiler, with compiler options "-O3" target machine: SPARC (Sun Blade 1000)"schedule" means instruction scheduling (with "nop"-instruction elimination, in case of SPARC), "pipelining" means software pipelining, and "regpromote" means register promotion of static variables. See 11. Structure and Extensions of the Backend Process for these optimizations. These are the added optimizations using the hook features of the backend process.


A standardized way to interact with the HTML document.
Makes sense when you think about the structure of HTML. A "DOM node" may be a tbody
element for instance, with several tr
as children.
Because today's web isn't static. Animations, notifications, new information... Lots of stuff happens after the page loaded. So we need to modify the DOM.
It's done through the global document
variable.
// selects the element with id "#content"
document.getElementById("content");
// by class, returns an array obviously
document.getElementsByClassName("thumb");
// by tag, also an array
document.getElementsByTagName("p");
// by tag and namespace, useful when dealing with SVG
document.getElementsByTagNameNS( svgNS, "text" );
// by css selector
document.querySelectorAll( "p > img" );
var h1 = document.createElement("h1");
h1.textContent = "HELLO WORLD";
document.body.appendChild( h1 );
var title = document.querySelector("h1.headline");
title.textContent = "Putin retires!";
// siteNotice has to be a direct descendant of content!
document
.getElementById("content")
.removeChild(document.getElementById("siteNotice"));
document
.getElementById("content")
.addEventListener( "click", function() {
// srsly tho, never use alert. horrible ux.
alert("YOU TOUCHED MAH BELLY");
});
Only Array-like objects (NodeList, HTMLCollection) that have a length
property, but are missing all the good stuff from Array.prototype like map
.
document.getElementsByTagName("p").map( function() {});
// Error: undefined is not a function
E.g.: removeChild
only removes on child at a time, need to build a loop if there are more.
They cook with water, too. Do not even think that you can support IE8 and modern Chrome with the same DOM API.
By default jQuery exports the global variable $
after it was loaded.
It is so common that the Chrome Developer Tools have $
as a shorthand for document.querySelectorAll
.
// $( mahCssSelector )
$(".my-class")
$("#my-id")
$("[my-attr]")
//...
// naming convention:
// everything that is a jquery selection starts with $
var $el = $("<div />");
$el.text("OH HI THERE");
$(document.body).prepend( $el );
// sets style attribute
$el.css({
color: '#fff',
background: 'red'
});
$el.toggleClass("is-enabled");
// $el["event"]
$el.hover(function() {
$( this ).css({
opacity: 0.75
});
});
$el.toggle( stateOneFunction, stateTwoFunction );
$el
.children()
.filter( ".only-this-class" )
.not( ".but-not-this-one" )
.last();
$el.remove();
var $canvas = $( canvas.getContainer() ),
$controls = $( '' ),
$zoomOut = $( '' ),
$zoomIn = $( '' ),
$zoomFit= $( '' ),
zlevel = 1,
zstep = 0.2;
$canvas.append( $controls );
$controls.append( $zoomIn );
$controls.append( $zoomOut );
$controls.append( $zoomFit );
$controls.addClass( 'bjs-zoom-controls' );
$zoomOut.addClass( 'bjs-zoom bjs-zoom-out' );
$zoomIn.addClass( 'bjs-zoom bjs-zoom-in' );
$zoomFit.addClass( 'bjs-zoom bjs-zoom-fit' );
$zoomOut.attr( 'title', 'Zoom out' );
$zoomIn.attr( 'title', 'Zoom in' );
$zoomFit.attr( 'title', 'Fit to viewport' );
// update our zoom level on viewbox change
eventBus.on( 'canvas.viewbox.changed', function( evt ) {
zlevel = evt.viewbox.scale;
});
// define click handlers for controls
$zoomFit.on( 'click', function() {
canvas.zoom( 'fit-viewport' );
});
In handlebars variables are denoted with double curly brackets.
// hint: you don't have to do this inline, just for simplicity
var src = '{{customer.name}}
{{customer.bio}}
';
var template = Handlebars.compile( src );
var html = template({
customer: {
name: 'nikolaus',
bio: 'grew up somewhere'
}
});
// insert it with $element.append( html ) or so
Build your UI declaratively, not imperatively.


This is a demo of a a new full-stack for delivering web apps, called CloudFIRE.
It uses NGINX as the web server, and extends it with lots of custom Lua code. The Lua code runs inside the memory of the Nginx workers, and provides the following services:
It can serve static content, dynamic content via FastCGI for each virtual host, and also serve static/cached content from Redis.


Exciting events you have to look forward to
Lorem ipsum cheberlu eklabu noiiice...
Talk to other people about a common topic
Get the latest updates