Note
Click here to download the full example code
Transfering a model from PyTorch to Caffe2 and Mobile using ONNX¶
In this tutorial, we describe how to use ONNX to convert a model defined in PyTorch into the ONNX format and then load it into Caffe2. Once in Caffe2, we can run the model to double-check it was exported correctly, and we then show how to use Caffe2 features such as mobile exporter for executing the model on mobile devices.
For this tutorial, you will need to install onnx,
onnx-caffe2 and Caffe2.
You can get binary builds of onnx and onnx-caffe2 with
conda install -c ezyang onnx onnx-caffe2
.
NOTE
: This tutorial needs PyTorch master branch which can be installed by following
the instructions here
# Some standard imports
import io
import numpy as np
from torch import nn
import torch.utils.model_zoo as model_zoo
import torch.onnx
Super-resolution is a way of increasing the resolution of images, videos and is widely used in image processing or video editing. For this tutorial, we will first use a small super-resolution model with a dummy input.
First, let’s create a SuperResolution model in PyTorch. This model comes directly from PyTorch’s examples without modification:
# Super Resolution model definition in PyTorch
import torch.nn as nn
import torch.nn.init as init
class SuperResolutionNet(nn.Module):
def __init__(self, upscale_factor, inplace=False):
super(SuperResolutionNet, self).__init__()
self.relu = nn.ReLU(inplace=inplace)
self.conv1 = nn.Conv2d(1, 64, (5, 5), (1, 1), (2, 2))
self.conv2 = nn.Conv2d(64, 64, (3, 3), (1, 1), (1, 1))
self.conv3 = nn.Conv2d(64, 32, (3, 3), (1, 1), (1, 1))
self.conv4 = nn.Conv2d(32, upscale_factor ** 2, (3, 3), (1, 1), (1, 1))
self.pixel_shuffle = nn.PixelShuffle(upscale_factor)
self._initialize_weights()
def forward(self, x):
x = self.relu(self.conv1(x))
x = self.relu(self.conv2(x))
x = self.relu(self.conv3(x))
x = self.pixel_shuffle(self.conv4(x))
return x
def _initialize_weights(self):
init.orthogonal_(self.conv1.weight, init.calculate_gain('relu'))
init.orthogonal_(self.conv2.weight, init.calculate_gain('relu'))
init.orthogonal_(self.conv3.weight, init.calculate_gain('relu'))
init.orthogonal_(self.conv4.weight)
# Create the super-resolution model by using the above model definition.
torch_model = SuperResolutionNet(upscale_factor=3)
Ordinarily, you would now train this model; however, for this tutorial, we will instead download some pre-trained weights. Note that this model was not trained fully for good accuracy and is used here for demonstration purposes only.
# Load pretrained model weights
model_url = 'https://s3.amazonaws.com/pytorch/test_data/export/superres_epoch100-44c6958e.pth'
batch_size = 1 # just a random number
# Initialize model with the pretrained weights
map_location = lambda storage, loc: storage
if torch.cuda.is_available():
map_location = None
torch_model.load_state_dict(model_zoo.load_url(model_url, map_location=map_location))
# set the train mode to false since we will only run the forward pass.
torch_model.train(False)
Exporting a model in PyTorch works via tracing. To export a model, you
call the torch.onnx._export()
function. This will execute the model,
recording a trace of what operators are used to compute the outputs.
Because _export
runs the model, we need provide an input tensor
x
. The values in this tensor are not important; it can be an image
or a random tensor as long as it is the right size.
To learn more details about PyTorch’s export interface, check out the torch.onnx documentation.
# Input to the model
x = torch.randn(batch_size, 1, 224, 224, requires_grad=True)
# Export the model
torch_out = torch.onnx._export(torch_model, # model being run
x, # model input (or a tuple for multiple inputs)
"super_resolution.onnx", # where to save the model (can be a file or file-like object)
export_params=True) # store the trained parameter weights inside the model file
torch_out
is the output after executing the model. Normally you can
ignore this output, but here we will use it to verify that the model we
exported computes the same values when run in Caffe2.
Now let’s take the ONNX representation and use it in Caffe2. This part can normally be done in a separate process or on another machine, but we will continue in the same process so that we can verify that Caffe2 and PyTorch are computing the same value for the network:
import onnx
import onnx_caffe2.backend
# Load the ONNX ModelProto object. model is a standard Python protobuf object
model = onnx.load("super_resolution.onnx")
# prepare the caffe2 backend for executing the model this converts the ONNX model into a
# Caffe2 NetDef that can execute it. Other ONNX backends, like one for CNTK will be
# availiable soon.
prepared_backend = onnx_caffe2.backend.prepare(model)
# run the model in Caffe2
# Construct a map from input names to Tensor data.
# The graph of the model itself contains inputs for all weight parameters, after the input image.
# Since the weights are already embedded, we just need to pass the input image.
# Set the first input.
W = {model.graph.input[0].name: x.data.numpy()}
# Run the Caffe2 net:
c2_out = prepared_backend.run(W)[0]
# Verify the numerical correctness upto 3 decimal places
np.testing.assert_almost_equal(torch_out.data.cpu().numpy(), c2_out, decimal=3)
print("Exported model has been executed on Caffe2 backend, and the result looks good!")
We should see that the output of PyTorch and Caffe2 runs match numerically up to 3 decimal places. As a side-note, if they do not match then there is an issue that the operators in Caffe2 and PyTorch are implemented differently and please contact us in that case.
Transfering SRResNet using ONNX¶
Using the same process as above, we also transferred an interesting new model “SRResNet” for super-resolution presented in this paper (thanks to the authors at Twitter for providing us code and pretrained parameters for the purpose of this tutorial). The model definition and a pre-trained model can be found here. Below is what SRResNet model input, output looks like.
Running the model on mobile devices¶
So far we have exported a model from PyTorch and shown how to load it and run it in Caffe2. Now that the model is loaded in Caffe2, we can convert it into a format suitable for running on mobile devices.
We will use Caffe2’s mobile_exporter to generate the two model protobufs that can run on mobile. The first is used to initialize the network with the correct weights, and the second actual runs executes the model. We will continue to use the small super-resolution model for the rest of this tutorial.
# extract the workspace and the model proto from the internal representation
c2_workspace = prepared_backend.workspace
c2_model = prepared_backend.predict_net
# Now import the caffe2 mobile exporter
from caffe2.python.predictor import mobile_exporter
# call the Export to get the predict_net, init_net. These nets are needed for running things on mobile
init_net, predict_net = mobile_exporter.Export(c2_workspace, c2_model, c2_model.external_input)
# Let's also save the init_net and predict_net to a file that we will later use for running them on mobile
with open('init_net.pb', "wb") as fopen:
fopen.write(init_net.SerializeToString())
with open('predict_net.pb', "wb") as fopen:
fopen.write(predict_net.SerializeToString())
init_net
has the model parameters and the model input embedded in it
and predict_net
will be used to guide the init_net
execution at
run-time. In this tutorial, we will use the init_net
and
predict_net
generated above and run them in both normal Caffe2
backend and mobile and verify that the output high-resolution cat image
produced in both runs is the same.
For this tutorial, we will use a famous cat image used widely which looks like below
# Some standard imports
from caffe2.proto import caffe2_pb2
from caffe2.python import core, net_drawer, net_printer, visualize, workspace, utils
import numpy as np
import os
import subprocess
from PIL import Image
from matplotlib import pyplot
from skimage import io, transform
First, let’s load the image, pre-process it using standard skimage python library. Note that this preprocessing is the standard practice of processing data for training/testing neural networks.
# load the image
img_in = io.imread("./_static/img/cat.jpg")
# resize the image to dimensions 224x224
img = transform.resize(img_in, [224, 224])
# save this resized image to be used as input to the model
io.imsave("./_static/img/cat_224x224.jpg", img)
Now, as a next step, let’s take the resized cat image and run the super-resolution model in Caffe2 backend and save the output image. The image processing steps below have been adopted from PyTorch implementation of super-resolution model here
# load the resized image and convert it to Ybr format
img = Image.open("./_static/img/cat_224x224.jpg")
img_ycbcr = img.convert('YCbCr')
img_y, img_cb, img_cr = img_ycbcr.split()
# Let's run the mobile nets that we generated above so that caffe2 workspace is properly initialized
workspace.RunNetOnce(init_net)
workspace.RunNetOnce(predict_net)
# Caffe2 has a nice net_printer to be able to inspect what the net looks like and identify
# what our input and output blob names are.
print(net_printer.to_string(predict_net))
From the above output, we can see that input is named “9” and output is named “27”(it is a little bit weird that we will have numbers as blob names but this is because the tracing JIT produces numbered entries for the models)
# Now, let's also pass in the resized cat image for processing by the model.
workspace.FeedBlob("9", np.array(img_y)[np.newaxis, np.newaxis, :, :].astype(np.float32))
# run the predict_net to get the model output
workspace.RunNetOnce(predict_net)
# Now let's get the model output blob
img_out = workspace.FetchBlob("27")
Now, we’ll refer back to the post-processing steps in PyTorch implementation of super-resolution model here to construct back the final output image and save the image.
img_out_y = Image.fromarray(np.uint8((img_out[0, 0]).clip(0, 255)), mode='L')
# get the output image follow post-processing step from PyTorch implementation
final_img = Image.merge(
"YCbCr", [
img_out_y,
img_cb.resize(img_out_y.size, Image.BICUBIC),
img_cr.resize(img_out_y.size, Image.BICUBIC),
]).convert("RGB")
# Save the image, we will compare this with the output image from mobile device
final_img.save("./_static/img/cat_superres.jpg")
We have finished running our mobile nets in pure Caffe2 backend and now, let’s execute the model on an Android device and get the model output.
NOTE
: for Android development, adb
shell is needed otherwise the
following section of tutorial will not run.
In our first step of runnig model on mobile, we will push a native speed
benchmark binary for mobile device to adb. This binary can execute the
model on mobile and also export the model output that we can retrieve
later. The binary is available
here.
In order to build the binary, execute the build_android.sh
script
following the instructions
here.
NOTE
: You need to have ANDROID_NDK
installed and set your env
variable ANDROID_NDK=path to ndk root
# let's first push a bunch of stuff to adb, specify the path for the binary
CAFFE2_MOBILE_BINARY = ('caffe2/binaries/speed_benchmark')
# we had saved our init_net and proto_net in steps above, we use them now.
# Push the binary and the model protos
os.system('adb push ' + CAFFE2_MOBILE_BINARY + ' /data/local/tmp/')
os.system('adb push init_net.pb /data/local/tmp')
os.system('adb push predict_net.pb /data/local/tmp')
# Let's serialize the input image blob to a blob proto and then send it to mobile for execution.
with open("input.blobproto", "wb") as fid:
fid.write(workspace.SerializeBlob("9"))
# push the input image blob to adb
os.system('adb push input.blobproto /data/local/tmp/')
# Now we run the net on mobile, look at the speed_benchmark --help for what various options mean
os.system(
'adb shell /data/local/tmp/speed_benchmark ' # binary to execute
'--init_net=/data/local/tmp/super_resolution_mobile_init.pb ' # mobile init_net
'--net=/data/local/tmp/super_resolution_mobile_predict.pb ' # mobile predict_net
'--input=9 ' # name of our input image blob
'--input_file=/data/local/tmp/input.blobproto ' # serialized input image
'--output_folder=/data/local/tmp ' # destination folder for saving mobile output
'--output=27,9 ' # output blobs we are interested in
'--iter=1 ' # number of net iterations to execute
'--caffe2_log_level=0 '
)
# get the model output from adb and save to a file
os.system('adb pull /data/local/tmp/27 ./output.blobproto')
# We can recover the output content and post-process the model using same steps as we followed earlier
blob_proto = caffe2_pb2.BlobProto()
blob_proto.ParseFromString(open('./output.blobproto').read())
img_out = utils.Caffe2TensorToNumpyArray(blob_proto.tensor)
img_out_y = Image.fromarray(np.uint8((img_out[0,0]).clip(0, 255)), mode='L')
final_img = Image.merge(
"YCbCr", [
img_out_y,
img_cb.resize(img_out_y.size, Image.BICUBIC),
img_cr.resize(img_out_y.size, Image.BICUBIC),
]).convert("RGB")
final_img.save("./_static/img/cat_superres_mobile.jpg")
Now, you can compare the image cat_superres.jpg
(model output from
pure caffe2 backend execution) and cat_superres_mobile.jpg
(model
output from mobile execution) and see that both the images look same. If
they don’t look same, something went wrong with execution on mobile and
in that case, please contact Caffe2 community. You should expect to see
the output image to look like following:
Using the above steps, you can deploy your models on mobile easily. Also, for more information on caffe2 mobile backend, checkout caffe2-android-demo.
Total running time of the script: ( 0 minutes 0.000 seconds)


The Outline Style
The outline-style property specifies the style of the outline.
The outline-style property can have one of the following values:
- dotted - Defines a dotted outline
- dashed - Defines a dashed outline
- solid - Defines a solid outline
- double - Defines a double outline
- groove - Defines a 3D grooved outline. The effect depends on the outline-color value.
- ridge - Defines a 3D ridged outline. The effect depends on the outline color value
- inset - Defines a 3D inset outline.
- outset - Defines a 3D outset outline.
- none - Defines no outline
- hidden - Defines a hidden outline.
The following example first sets a thin black border around each p element, then it shows the different outline-style values.


| ID | Title | Duration (ms) |
|---|---|---|
| 1 | GetAddress #new returns a 'GetAddress' object | 5 |
| 2 | GetAddress #new doesn't require the 'new' keyword to create an instance of 'GetAddress' | 1 |
| 3 | GetAddress #new throws an error if initialised without an api key | 0 |
| 4 | GetAddress #new throws and error if initialised with an api key < 26 characters | 0 |
| 5 | GetAddress #new doesn't throw an error if the api key appears valid (26 characters) | 1 |
| 6 | GetAddress #new loads api configuration | 2 |
| 7 | GetAddress .options to have only the number of options required | 0 |
| 8 | GetAddress .options to have sane defaults | 1 |
| 9 | GetAddress .auth to be a valid property for use in making api calls | 0 |
| 10 | GetAddress .endpoints to include a valid endpoint for 'usage' calls | 0 |
| 11 | GetAddress .endpoints to include a valid endpoint for 'locate' calls | 7 |
| 12 | GetAddress #request is a method of the 'GetAddress' object | 0 |
| 13 | GetAddress #usage is a method of the 'GetAddress' object | 1 |
| 14 | GetAddress #usage accepts a single parameter, the 'callback' function | 6 |
| 15 | GetAddress #usage will throw an error if called without a 'callback' function | 2 |
| 16 | GetAddress #usage will return an object you can use to make the request | 0 |
| 17 | GetAddress #usage can be run by calling #exec on the object returned | 28 |
| 18 | GetAddress #locate is a method of the 'GetAddress' object | 0 |
| 19 | GetAddress #locate accepts a 'query' parameter as it's first parameter that should be a string | 2 |
| 20 | GetAddress #locate will throw an error if it's first parameter isn't a string | 0 |
| 21 | GetAddress #locate will throw an error if it's first parameter isn't a valid postcode format | 1 |
| 22 | GetAddress #locate accepts a 'callback' function as it's second argument | 1 |
| 23 | GetAddress #locate will throw an error if called without a 'callback' function | 0 |
| 24 | GetAddress #locate will modify the endpoint of the request to include the query | 1 |
| 25 | GetAddress #locate will return an object you can use to make the request | 1 |
| 26 | GetAddress #locate can be run by calling #exec on the object returned | 4 |
| 27 | Request #new returns a 'Request' object | 1 |
| 28 | Request #new doesn't require the 'new' keyword to create an instance of 'Request' | 1 |
| 29 | Request #new require's a single parameter, 'endpoint', that is a valid 'unirest' object | 0 |
| 30 | Request #new throws an error an 'endpoint' paramter isn't provided | 0 |
| 31 | Request #exec is a method of the 'Request' object | 1 |
| 32 | Request #exec expects a callback as it's only parameter | 2 |
| 33 | Request #exec will throw an error if not provided with a callback | 1 |
| 34 | Request #exec will make the call to the external api | 2 |
| Line | Lint | Hits | Source |
|---|---|---|---|
| 1 | |||
| 2 | 1 | function GetAddress () { | |
| 3 | |||
| 4 | 28 | if (!(this instanceof GetAddress)) { | |
| 5 | 2 | return new GetAddress(); | |
| 6 | } | ||
| 7 | |||
| 8 | 26 | this.key = process.env['GA_KEY']; | |
| 9 | |||
| 10 | if ( !this.key || this.key.length !== 26) { |
||
| 11 | 2 | throw new Error('invalid api key'); | |
| 12 | } | ||
| 13 | |||
| 14 | 24 | this.options = require('../config/config.json'); | |
| 15 | |||
| 16 | 24 | this.auth = { | |
| 17 | user: 'api-key', | ||
| 18 | pass: this.key | ||
| 19 | }; | ||
| 20 | |||
| 21 | 24 | this.endpoints = { | |
| 22 | usage: require('unirest').get(this.options.api + this.options.usage), | ||
| 23 | locate: require('unirest').get(this.options.api + this.options.locate) | ||
| 24 | } | ||
| 25 | |||
| 26 | 24 | this.endpoints.usage.auth(this.auth); | |
| 27 | 24 | this.endpoints.locate.auth(this.auth); | |
| 28 | |||
| 29 | } | ||
| 30 | |||
| 31 | 1 | GetAddress.prototype.request = require('./request'); | |
| 32 | |||
| 33 | 1 | GetAddress.prototype.usage = function (callback) { | |
| 34 | |||
| 35 | 4 | if (typeof callback !== 'function') { | |
| 36 | 1 | throw new Error('no callback function provided'); | |
| 37 | } | ||
| 38 | |||
| 39 | // call #exec on the returned object to complete the request. | ||
| 40 | 3 | return { | |
| 41 | |||
| 42 | endpoint: this.endpoints.usage, | ||
| 43 | request: this.request(this.endpoints.usage), | ||
| 44 | exec: function () { | ||
| 45 | 1 | this.request.exec(callback); | |
| 46 | } | ||
| 47 | |||
| 48 | } | ||
| 49 | |||
| 50 | }; | ||
| 51 | |||
| 52 | 1 | GetAddress.prototype.locate = function (query, callback) { | |
| 53 | |||
| 54 | 8 | if (typeof query !== 'string' || !this.is_postcode(query)) { | |
| 55 | 2 | throw new Error('called with an invalid query'); | |
| 56 | } | ||
| 57 | |||
| 58 | 6 | if (typeof callback !== 'function') { | |
| 59 | 1 | throw new Error('no callback function provided'); | |
| 60 | } | ||
| 61 | |||
| 62 | // add the query onto the end of the current request | ||
| 63 | 5 | var url = this.endpoints.locate.options.url; | |
| 64 | 5 | this.endpoints.locate.options.url = url + '/' + query; | |
| 65 | |||
| 66 | // call #exec on the returned object to complete the request | ||
| 67 | 5 | return { | |
| 68 | |||
| 69 | endpoint: this.endpoints.locate, | ||
| 70 | request: this.request(this.endpoints.locate), | ||
| 71 | exec: function () { | ||
| 72 | 1 | this.request.exec(callback); | |
| 73 | } | ||
| 74 | |||
| 75 | } | ||
| 76 | |||
| 77 | }; | ||
| 78 | |||
| 79 | 1 | GetAddress.prototype.is_postcode = function (postcode) { | |
| 80 | |||
| 81 | 7 | var re = new RegExp(/[A-Z]{1,2}[0-9][0-9A-Z]?\s?[0-9][A-Z]{2}/i); | |
| 82 | |||
| 83 | 7 | if (re.test(postcode)) { | |
| 84 | 6 | return true | |
| 85 | } else { | ||
| 86 | 1 | return false | |
| 87 | } | ||
| 88 | |||
| 89 | }; | ||
| 90 | |||
| 91 | 1 | module.exports = GetAddress; | |
| 92 |
| Line | Lint | Hits | Source |
|---|---|---|---|
| 1 | |||
| 2 | 1 | function Request (endpoint) { | |
| 3 | |||
| 4 | 25 | if(!(this instanceof Request)) { | |
| 5 | 9 | return new Request(endpoint); | |
| 6 | } | ||
| 7 | |||
| 8 | 16 | if (!endpoint) { | |
| 9 | 1 | throw new Error('no endpoint provided'); | |
| 10 | } else { | ||
| 11 | 15 | this.endpoint = endpoint; | |
| 12 | } | ||
| 13 | |||
| 14 | } | ||
| 15 | |||
| 16 | 1 | Request.prototype.exec = function (callback) { | |
| 17 | |||
| 18 | 5 | if (typeof callback !== 'function') { | |
| 19 | 1 | throw new Error('no callback function provided'); | |
| 20 | } | ||
| 21 | |||
| 22 | 4 | this.endpoint.end(function (response) { | |
| 23 | |||
| 24 | callback({ | ||
| 25 | status: response.status, | ||
| 26 | body: response.body | ||
| 27 | }); | ||
| 28 | |||
| 29 | }); | ||
| 30 | |||
| 31 | }; | ||
| 32 | |||
| 33 | 1 | module.exports = Request; | |
| 34 |


Recipe 1.1. Processing a String One Character at a Time
Credit: Luther Blissett
Problem
You want to process a string one character at a time.
Solution
You
can build a list whose items are the string's
characters (meaning that the items are strings, each of length of
onePython doesn't have a special type for
"characters" as distinct from
strings). Just call the built-in list, with the
string as its argument:
thelist = list(thestring)
You may not even need to build the list, since you can loop directly
on the string with a for statement:
for c in thestring:
do_something_with(c)
or in the for clause of a list comprehension:
results = [do_something_with(c) for c in thestring]
or, with exactly the same effects as this list comprehension, you can
call a function on each character with the map
built-in function:
results = map(do_something, thestring)
Discussion
In Python,
characters are just strings of length one. You can loop over a string
to access each of its characters, one by one. You can use
map for much the same purpose, as long as what you
need to do with each character is call a function on it. Finally, you
can call the built-in type list to obtain a list
of the length-one substrings of the string (i.e., the
string's characters). If what you want is a set
whose elements are the string's characters, you can
call sets.Set with the string as the argument (in
Python 2.4, you can also call the built-in set in
just the same way):
import sets
magic_chars = sets.Set('abracadabra')
poppins_chars = sets.Set('supercalifragilisticexpialidocious')
print ''.join(magic_chars & poppins_chars) # set intersection
acrd
See Also
The Library Reference section on sequences;
Perl Cookbook Recipe 1.5.
|


When you first start Google Earth, the Places panel contains an empty My
Places folder to hold places that you want to save. (If you are upgrading from a
previous version of Google Earth, Google Earth imports your saved places.) Every item
located in the My Places folder is saved for subsequent Google Earth sessions.
Items located in the Places panel but not saved in the
My Places folder are located in the Temporary Places folder and are
unavailable in the next Google Earth session if you do not move or save them to your
My Places folder.
You can use the Places panel to save and organize places that you visit, address
or listing searches, natural features, and more.
This section covers the basic ways to add a placemark to the My Places folder:
For more information on other things you can do with placemarks, see Using Places.
Tip: If Google Earth takes a long time to load, you might have more
places saved than your computer can reasonably handle. Try moving some of the places you
don't regularly visit to a folder and saving that folder to your computer. See Saving and Sharing Places.
Follow these instructions to add a new placemark to any spot in the viewer.
Position the 3D viewer to contain the spot you want to placemark. Consider zooming
into the best viewing level for the desired location. Choose any one of the following
methods:
Select Placemark from the Add Menu.
Click the Placemark icon on the toolbar menu at the the top of the screen
The New Placemark dialog box appears and a New Placemark icon is
centered in the viewer inside a flashing yellow square. Position the placemark. To do
this, position the cursor on the placemark until the cursor changes to a pointing
finger and drag it to the desired location. The cursor changes to a finger pointing
icon to indicate that you can move the placemark.
You can also lock the placemark position or set advanced coordinates for its position.
Set the following properties for the new placemark:
Style, Color - Choose a color, scale (size) and opacity for the
placemark icon
View - Choose a position for the placemark. For explanation of
terms in this tab, mouse over each field. Click Snapshot current view to
apply the current view (altitude and camera angle) to this placemark.
Altitude - Choose the height of the placemark as it appears over
terrain with a numeric value or the slider. Choose Extend to ground to
show the placemark attached to a line anchored to the ground.
(Icon) - Click the icon for the placemark (top right corner of the
dialog box) to choose an alternate icon.
Click OK to apply the information you entered in the
placemark dialog box.
Your placemark appears in the 3D viewer and as an entry in the selected folder. Once you
save this placemark, you can always change its position and properties. See Editing Places and Folders for more information.
Saving a Point of Interest
You can save any point of interest (POI) displayed in the 3D viewer to the My
Places folder by right-clicking (CTRL clicking on the Mac) on the placemark in the
viewer and selecting Save to My Places from the pop-up menu.
You can also use the copy feature as follows:
Right-click (CTRL click on the Mac) on a POI and select Copy from the pop-up menu.
Open the My Places folder to display the destination folder for the POI.
Position your cursor over the desired folder or sub-folder.
Right-click (CTRL click on the Mac) and select Paste from the pop-up menu. The POI
appears in the location you selected.
You can also move a saved POI to any folder in your Places panel. See Organizing Places for more information.
Sharing a Placemark
After you have created a placemark, you can easily share it with others on the Google Earth Community BBS website. To do this, right click
(CTRL click on the Mac) on the placemark and choose Share/Post. The Google Earth
Community posting wizard appears in a browser window at the bottom of your screen. Follow
the instructions on this web page to post information about this placemark on the Google
Earth BBS.
Note - You can also share information that appears in Google Earth via
KML files.
Saving Search Results
After you perform a search, a listing results panel also appears below the
Search button. Each search term you enter is the title for the folder containing
the top 10 results within it. You can collapse a particular search folder by clicking on
the minus icon next to the search term. While you are logged in, you can revisit your
search results just by double-clicking on an item in the search list. You can clear
search results from the listing by clicking on the Clear button
(X).
Once you log out of Google Earth, your search terms are cleared. However, you can save
search results for future Google Earth sessions in the following ways:
Drag and drop a search result item from the search results panel to any folder within
the Places panel. Release the item to place it in the new location.
Right-click (CTRL click on the Mac) on a search result in either the listing or the
3D viewer and select Save to My Places from the pop-up menu.
Use the copy feature by right-clicking (CTRL clicking on the Mac) on a result listing
in either the viewer or the Search panel and selecting Copy from the pop-up menu. From
there, right-click (CTRL click on the Mac) on a folder in the Places panels where you
want to save the search result and select Paste from the pop-up menu to paste the search
result in your new location.
Tip: You can also save the contents of the entire search result to the
Places panel by selecting the folder containing your search results and dragging
it to the desired location.
Once a search result is saved, you can change its title, location, and description. See
Editing Placemark or Folder for information.
Saving Images
Note - This feature is available to users of the Google Earth Pro and
Google Earth EC products. Visit http://earth.google.com/products.html for
more information.
Use File > Save > Save Image to save the current view as
an image file to your computer's hard drive. When you save an image, a Save
dialog box appears and you can locate a folder on your computer to save the image to,
just as you would for any document you might save. The image is saved with all visible
placemarks, borders, or other Layer information visible in the 3D viewer.
You can save images in the following resolutions:
Screen
1000 pixels
Google Earth PRO/EC users can save images in the following resolutions:
1400 pixels
2400 pixels
4800 pixels
Printing
Use the Print... command under the File menu to print the current view.
You can also type Ctrl ( on the Mac) + P. When you
print an image, a Print dialog box appears that asks you to choose one of the
following:
Graphic of 3D Viewer - Choose an appropriate resolution. You can then select
available printers, just as you would for any document. The image is printed with all
visible placemarks, borders, or other layer information visible in the 3D viewer.
Most recent Search Results - Choose this if you want to print search results
or driving directions
Selected Folders/Placemarks in My Places - This is available if you have
selected any placemark or folder in the Places folder. This prints the current 3D view
plus placemark information and images.
Note - Some of these printing options are only available to Google Earth
Pro and EC users.


{% extends "base.html" %} {% from 'macros.html' import listPersonFields %} {# Show details for a person. Also lists all users attached to that person and allows one to edit or add users. Allows deletion of the person if current user is admin. #} {% block content %}
Users: {% for user in person.users %} {{ user.user_name }} {% endfor %} | +
Doctors (IDs): {{ doctorList }}
Patients (IDs): {{ patientList }}


extractors.iGAIT¶
Module: extractors.iGAIT
¶
This program implements some of the feature extraction equations from:
“iGAIT: An interactive accelerometer based gait analysis system” Mingjing Yang, Huiru Zheng, Haiying Wang, Sally McClean, Dave Newell. 2012. Computer methods and programs in biomedicine 108:715-723. DOI:10.1016/j.cmpb.2012.04.004 http://www.ncbi.nlm.nih.gov/pubmed/22575802
- iGAIT inputs ::
- sample rate
- distance (not included here)
- threshold (anterior-posterior acceleration, to detect heel contact)
iGait was written as a Matlab file and compiled as a Windows application.
- Features ::
cadence (step/min)
distance-related (not included here): velocity, mean step length
RMS (each direction)
integral of the power spectral density (PSD, each direction)
main frequency: frequency with the maximum value of PSD
frequency of cumulated IPSD at 50/75/90/99% energy (each direction)
- autocorrelation coefficients-derived:
- symmetry (vertical and anterior-posterior directions)
- regularity of stride/step (each direction)
- Authors:
- Arno Klein, 2015<EMAIL_ADDRESS>http://binarybottle.com
Copyright 2015, Sage Bionetworks (http://sagebase.org), Apache v2.0 License
Functions¶
-
mhealthx.extractors.iGAIT.
autocorrelation
(data, unbiased=True, normalized=True)¶ Compute the autocorrelation coefficients for time series data.
From Yang, et al., 2012:
“The autocorrelation coefficient refers to the correlation of a time series with its own past or future values. iGAIT uses unbiased autocorrelation coefficients of acceleration data to scale the regularity and symmetry of gait [30]. The unbiased estimate of autocorrelation coefficients of acceleration data can be calculated by Eq. (5)
fc(t) = 1/(N-|t|) * SUM[i=1:N-|t|](xi * x_i+t)
where xi (i=1,2,...,N) is the acceleration data, fc(t) are autocorrelation coefficients, t is the time lag (t=-N,-N+1,...,0,1,2,...,N).
When the time lag t is equal to the periodicity of the acceleration xi, a peak will be found in the fc(t) series. The autocorrelation coefficients are divided by fc(0) in Eq. (6), so that the autocorrelation coefficient is equal to 1 when t=0
NFC(t) = fc(t) / fc(0)
Here NFC(t) is the normalised autocorrelation coefficient, and fc(t) are autocorrelation coefficients.”
- data : numpy array
- time series data
- unbiased : Boolean
- compute unbiased autocorrelation?
- normalized : Boolean
- compute normalized autocorrelation?
- coefficients : numpy array
- [normalized, unbiased] autocorrelation coefficients
>>> import numpy as np >>> from mhealthx.extractors.iGAIT import autocorrelation >>> data = np.random.random(100) >>> unbiased = True >>> normalized = True >>> coefficients = autocorrelation(data, unbiased, normalized)
From “Efficient computation of autocorrelations; demonstration in MatLab and Python” (Dec. 29, 2013) by Jesper Toft Kristensen: http://jespertoftkristensen.com/JTK/Blog/Entries/2013/12/29_Efficient_ computation_of_autocorrelations%3B_demonstration_in_MatLab_and_Python.html
-
mhealthx.extractors.iGAIT.
gait
(x, y, z, t, sample_rate, duration, threshold=0.2, order=4, cutoff=5)¶ Estimate various gait measures from time series (accelerometer) data.
From Yang, et al., 2012:
Re: heel strikes: “The heel contacts are detected by peaks preceding the sign change of AP acceleration [3]. In order to automatically detect a heel contact event, firstly, the AP acceleration is low pass filtered by the 4th order zero lag Butterworth filter whose cut frequency is set to 5 Hz. After that, transitional positions where AP acceleration changes from positive to negative can be identified. Finally the peaks of AP acceleration preceding the transitional positions, and greater than the product of a threshold and the maximum value of the AP acceleration are denoted as heel contact events... This threshold is defined as the ratio to the maximum value of the AP acceleration, for example 0.5 indicates the threshold is set at 50% of the maximum AP acceleration. Its default value is set to 0.4 as determined experimentally in this paper, where this value allowed correct detection of all gait events in control subjects. However, when a more irregular pattern is analysed, the threshold should be less than 0.4. The user can test different threshold values and find the best one according to the gait event detection results.”
- x : list
- x-axis accelerometer data
- y : list
- y-axis accelerometer data
- z : list
- z-axis accelerometer data
- t : list
- time points for accelerometer data
- sample_rate : float
- sample rate of accelerometer reading (Hz)
- duration : float
- duration of accelerometer reading (s)
- threshold : float
- ratio to the maximum value of the anterior-posterior acceleration
- order : integer
- order of the Butterworth filter
- cutoff : integer
- cutoff frequency of the Butterworth filter (Hz)
- heel_strikes : numpy array
- heel strike timings
- number_of_steps : integer
- estimated number of steps based on heel strikes
- cadence : float
- number of steps divided by duration
- step_durations : numpy array
- step durations
- avg_step_duration : float
- average step duration
- sd_step_durations : float
- standard deviation of step durations
- strides : list of two lists of floats
- stride timings for each side
- avg_number_of_strides : float
- estimated number of strides based on alternating heel strikes
- stride_durations : list of two lists of floats
- estimated stride durations
- avg_stride_duration : float
- average stride duration
- sd_step_durations : float
- standard deviation of stride durations
- step_regularity_x : float
- measure of step regularity in x-axis
- step_regularity_y : float
- measure of step regularity in y-axis
- step_regularity_z : float
- measure of step regularity in z-axis
- stride_regularity_x : float
- measure of stride regularity in x-axis
- stride_regularity_y : float
- measure of stride regularity in y-axis
- stride_regularity_z : float
- measure of stride regularity in z-axis
- symmetry_x : float
- measure of gait symmetry in x-axis
- symmetry_y : float
- measure of gait symmetry in y-axis
- symmetry_z : float
- measure of gait symmetry in z-axis
>>> from mhealthx.xio import read_accel_json, compute_sample_rate >>> input_file = '/Users/arno/DriveWork/mhealthx/mpower_sample_data/accel_walking_outbound.json.items-6dc4a144-55c3-4e6d-982c-19c7a701ca243282023468470322798.tmp' >>> x, y, z, t, sample_rate, duration = read_accel_json(input_file) >>> from mhealthx.extractors.iGAIT import gait >>> threshold = 0.2 >>> order = 4 >>> cutoff = 5 >>> data = y >>> a = gait(x, y, z, t, sample_rate, duration, threshold, order, cutoff)
-
mhealthx.extractors.iGAIT.
gait_regularity_symmetry
(x, y, z, step_period, stride_period)¶ Compute step and stride regularity and symmetry from accelerometer data.
From Yang, et al., 2012:
“The peak value a1 = NFC(t1), which is found at the t1 lag time to be a step period, indicates the step regularity in a direction. The peak value a2 = NFC(t2), which was found at the t2 lag time to be a stride period, indicates the stride regularity in a direction. The variance of the stride regularity and step regularity D = |a2 - a1, can be used as an indicator to measure gait asymmetry. A smaller value of D indicates a more symmetric gait. A larger value of D indicates a more asymmetric gait. In total, iGAIT extracts seven regularity and symmetry features from the acceleration data, namely
- Step regularity: vertical (VT), anterior-posterior (AP) directions - Stride regularity: VT, AP, medial-lateral (ML) directions - Symmetry: VT, AP directions
- x : list
- x-axis accelerometer data
- y : list
- y-axis accelerometer data
- z : list
- z-axis accelerometer data
- step_period : integer
- step period
- stride_period : integer
- stride period
- step_regularity_x : float
- step regularity measure in medial-lateral direction
- step_regularity_y : float
- step regularity measure in anterior-posterior direction
- step_regularity_z : float
- step regularity measure in vertical direction
- stride_regularity_x : float
- stride regularity measure in medial-lateral direction
- stride_regularity_y : float
- stride regularity measure in anterior-posterior direction
- stride_regularity_z : float
- stride regularity measure in vertical direction
- symmetry_x : float
- symmetry measure in medial-lateral direction
- symmetry_y : float
- symmetry measure in anterior-posterior direction
- symmetry_z : float
- symmetry measure in vertical direction
>>> from mhealthx.xio import read_accel_json >>> from mhealthx.extractors.iGAIT import gait_regularity_symmetry >>> input_file = '/Users/arno/DriveWork/mhealthx/mpower_sample_data/accel_walking_outbound.json.items-6dc4a144-55c3-4e6d-982c-19c7a701ca243282023468470322798.tmp' >>> x, y, z, t, sample_rate, duration = read_accel_json(input_file) >>> step_period = 2 >>> stride_period = 1 >>> a = gait_regularity_symmetry(x, y, z, step_period, stride_period)
-
mhealthx.extractors.iGAIT.
rms
(data)¶ The root mean square of acceleration indicates the intensity of motion. The RMS values of the three acceleration directions (VT, AP and ML) are calculated as: RMS_d = sqrt( (sum[i=0:N-1](xdi - [xd])^2 / N) ) where xdi (i = 1,2,...,N; d = VT,AP,ML) is the acceleration in either the VT, AP or ML axis, N is the length of the acceleration signal, [xd] is the mean value of acceleration in any axis.


Home
Washington, D.C. |
Maryland |
Virginia |
Escape from Reality |
Toggle Dark Mode
Virginia Stats
View the Executive Order from the Governor of Virginia here.
Tweets by VDHgov


Product Landing
Single page site that showcases a company's three most prominent products. Users are greeted with a splash page with navigation links. Next pane has photos and brief descriptions of the three products. Users can hover on the photos to rotate to the reverse and also click for zooming. A video and information request panels are available. Completely mobile responsive.


Before Change
"\t-e UID=`id -u` \\ \n"
"\tdeepfakes-gpu\n\n"
"6. Open a new terminal to interact with the project\n"
"docker exec deepfakes-gpu python /srv/tools.py gui\n".format(path=sys.path[0]))
def macos(self):
Output Tips for macOS
After Change
"\t-e UID=`id -u` \\ \n"
"\tdeepfakes-gpu\n\n"
"6. Open a new terminal to interact with the project\n"
"docker exec deepfakes-gpu python /srv/tools.py gui\n".format(path=os.path.dirname(os.path.realpath(__file__))))
def macos(self):
Output Tips for macOS


Create New Role
List of roles
Role Name
Context Type
Users in role
Permissions
Rank
No Users
No Permissions
Edit
Delete
Total Results:
RoleId
Name
The name is required
The name of the role must be unique
Description
Context Type
Permissions
Save Role
Are you sure you want to delete the role
?
The role has
active users attached.
Delete
Cancel


Friendly and dedicated Android Developer, able to learn new and emerging technology quickly. Looking for more opportunities to learn and develop myself to be a better programmer.
High-energy student currently in the fourth year of a five-year bachelor's degree programme in Computer Engineering and prepared to contribute abilities to fit into the role of an intern while further developing acquired skills and gaining real-world experience. Highly organized, responsible and well-versed in fundamentals of Computer Engineering. Offering ability to learn quickly, advanced computer proficiency and training in mobile development. Flexible and hardworking team player focused on boosting efficiency and performance with conscientious and detail-oriented approaches.
Undergraduate Intern at Dev. District Innovation Hub – Akure, Ondo State, 11/2018 to 01/2019.
Federal University of Technology,Akure
Bachelor of Engineering degree in Computer Engineering September ,2020 (in view)
Microsoft Office, Android Studio, Microsoft Visual Studio, PROTEUS, OrCAD, ModelSim and LATEX.
Team leader- Guest Reception and Follow-up in local christian assembly


About
- B.S. Major: Computer Engineering (IOT Focus)
- Minor(s): Software Development and Mathematics
- B.S. Graduation: May 2022 (expected)
I am a senior at Minnesota State University, Mankato majoring in Computer Engineering with a minor in Software Development and Math.
Ilham translates to "Inspiration" in English which is one of the 3 core values I have. The other 2 being Resiliency and Adaptability. Inspiration is important to me because everyone has qualities that inspire me to be who I am. I aspire to provide others the same inspiration they provide me. Resiliency prevents me from giving up and never seeing the end result. Adaptability is vital to navigate and grow in an unpredictable world. I aspire to be a product manager that can promote these 3 values by helping others succeed, discovering creative solutions, and learning from past experiences.
Key Projects
- All
- Software
- Hardware
- Other
Key Experiences
Lead Software Engineer
June 2021 - Present
Cledge, Redmond, WA
- Spearheading the engineering team in an Agile development environment to create a web platform that democratizes personalized college counseling
- Built the user profiling functionality and a heuristic tag-matching algorithm for content recommendation using Flutter and a NoSQL Cloud Firestore database on Firebase
- Developed database management consoles using Node.js and React.js, resulting in a 75% reduction in data entry time for content developers
- Built a data pipeline using Python and Apache Spark to populate an Azure Cognitive Search Index with data from the College Scorecard and IPEDS datasets
- Built a fully automated Python web scraper using Selenium to scrape Creative Commons licensed images of college campuses from Google Image Search
- Picked up by Microsoft for Startups in July 2021
- Tools and technologies: Firebase, Flutter, Dart, GitHub, Trello
Technical Project Lead & Lead Software Engineer
April 2019 - June 2021
Autonomous Flight Systems Laboratory
University of Washington College of Engineering, Seattle, WA
- Project: Laboratory Reconciliation and Information System (LARI)
- Developed a data management solution to streamline hardware components tracking and flight data and implemented automatic flight checklist generating functionality to reduce transition period between readiness and testing by 80%
- Lead weekly standup meetings in Agile development environment and managed project codebase migration from Perforce to GitHub
- Tools and technologies: Java, Swing, SQLite, GitHub, Trello
CodeLabs Intern
July 2020 - August 2020
CodeDay, Remote
- Developed a resume classification platform based on best-matching potential job categories (examples: Data Scientist, Java Developer, HR, etc.)
- Implemented a data processing pipeline on a resume dataset
- Used natural language processing and regular expression matching techniques to extract meaningful content from text
- Developed a multiclass convolutional neural network to generate probability distributions for classification results
- Deployed the deep learning pipeline on the web platform to allows users to classify their resume
- Tools and technologies: Python, TensorFlow, Keras, NLTK, Node.js, Express.js, JavaScript, HTML, CSS, Heroku, Jira
Software Engineering Intern
August 2019 - September 2019
Tata Consultancy Services, Bellevue, WA
- Project: Meetings Monitor
- Developed a cross platform application to snapshot a conference room at regular intervals
- Implemented human detection and facial recognition on conference room snapshots
- Integrated real-time storage of snapshots in a data lake and time-stamped analysis results in a key-value store
- Implemented localized offline human detection to optimize API calls, reducing application cost by 90%
- Documented product development process and dependencies
- Tools and technologies: Raspberry Pi 4, C# (.NET Core), OpenCV (OpenCvSharp, HaarCascades), Microsoft Azure (Cognitive Services, Computer Vision API, Face API, Table Storage, Blob Storage, DevOps)
Awards
Academics
Education
Master of Science in Computer Science
September 2021 - June 2022
University of Washington, Seattle, WA
Bachelor of Science in Computer Science
September 2018 - June 2021
University of Washington, Seattle, WA
- GPA: 3.97 / 4.00
- Minor: Mathematics
- Specialization in the Data Science option
- Officer at Husky Spikeball Club (also a Spikeball Ambassador)
International Baccalaureate Diploma (IB DP)
September 2016 - June 2018
Skyline High School, Sammamish, WA
- GPA: 3.93 / 4.00
- Higher Level: Mathematics, Physics, English A: Literature
- Standard Level: Chemistry, Business Management, French B
- Achieved grade A in Extended Essay in Mathematics
International Baccalaureate Middle Years Program (IB MYP)
August 2014 - June 2016
International School of Helsinki, Helsinki, Finland
- Subjects: Higher Level Mathematics, English, Science, Physical Education & Health, Humanities, Digital Design, Music, French B
- Achieved a perfect score on the MYP Personal Project
Relevant Coursework
Current Coursework
Fall 2021
Graduate Courses
- Deep Learning
Python, PyTorch
Prior Coursework
Graduate Courses- Machine Learning for Big
Data
Python, Apache Spark
- Machine Learning
Python, PyTorch
- Algorithms
- Database Systems
Internals
Java
- Computer Security
x86-64 Assembly, C, JavaScript
- Computer Communication
Networks
Java, Python
- Data Visualization
Vega-Lite, D3.js
- Systems Programming
C, C++
- Data Management
Java, SQL, NoSQL
- Data Structures and
Parallelism
Java
- Software Design and
Implementation
Java
- The Hardware / Software
Interface
x86-64 Assembly, C
- Discrete Mathematics
- Probability and Statistics
What People Say About Me
Name
Web Developer
Say something
Name
Test Engineer at Itron
I had the privilege to work with Mohammad for last 2 years. He has demonstrated varied knowledge and the ability to adapt to new technology given a short amount of time. He is always on time, clear on communication and tries to do the best he can of whatever task he is given. He will be a good asset for any team he will join.
Adnan Oztas
A Level Mathematics Teacher at International Hope School Bangladesh
Mohammad is humble, but does not hesitate to share his approach for problem solving, and yet he is sensitive to the feelings of others. As a result, he is well respected by his peers and his teachers. Through two years’ observation as his classroom teacher, it is evident that Mohammad is accountable, kind, a hard worker, and resilient.


1 reference to WriteModulePreamble
System.Management.Automation (1)
cimSupport\cmdletization\ScriptWriter.cs (1)
2133
this.
WriteModulePreamble
(output);


Systems-Based Practice in Osteopathic Medicine
Health systems awareness
Engage in an interprofessional health care team for ordering patient- and population-centered care
Incorporate considerations of cost awareness and risk-benefit analysis in care
Advocate for all patients within the healthcare system
Improve health systems and patient safety


-
A quiz to test your knowledge on latest front end tools.
Roles: Design, Development
Tags: React, NodeJS, Sketch, CSS3
-
Simple periodic table with design inspired from Isotope.
Roles: Development
Tags: CSS3, VelocityJS, jQuery
-
A modern and clean theme for jenkins.
Roles: Development
Tags: CSS3
-
An attempt to modernise IRCTC with clean and simple design.
Roles: Design
Tags: Sketch
-
A working model of T9 keypad phone in CSS3 / JS.
Roles: Design, Development
Tags: CSS3, jQuery


This class is a derivative of the standard InputSource class. More...
#include <LocalFileInputSource.hpp>
Public Member Functions | |
Constructors | |
| LocalFileInputSource (const XMLCh *const basePath, const XMLCh *const relativePath, MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager) | |
| A local file input source requires a path to the file to load. | |
| LocalFileInputSource (const XMLCh *const filePath, MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager) | |
| This constructor takes a single parameter which is the fully qualified or relative path. | |
Destructor | |
| ~LocalFileInputSource () | |
Virtual methods | |
| virtual BinInputStream * | makeStream () const |
| This method will return a binary input stream derivative that will parse from the local file indicatedby the system id. |
This class is a derivative of the standard InputSource class.
It provides for the parser access to data which is referenced via a local file path, as apposed to remote file or URL. This is the most efficacious mechanism by which local files can be parsed, since the parse knows that it refers to a local file and will make no other attempts to interpret the passed path.
The path provided can either be a fully qualified path or a relative path. If relative, it will be completed either relative to a passed base path or relative to the current working directory of the process.
As with all InputSource derivatives. The primary objective of an input source is to create an input stream via which the parser can spool in data from the referenced source.
| xercesc::LocalFileInputSource::LocalFileInputSource | ( | const XMLCh *const | basePath, | |
| const XMLCh *const | relativePath, | |||
| MemoryManager *const | manager = XMLPlatformUtils::fgMemoryManager | |||
| ) |
A local file input source requires a path to the file to load.
This can be provided either as a fully qualified path, a path relative to the current working directly, or a path relative to a provided base path.
The completed path will become the system id of this input source. The constructors don't take any public id for local files, but you still set them via the parent class' setPublicId() method of course.
This constructor takes an explicit base path and a possibly relative path. If the relative path is seen to be fully qualified, it is used as is. Otherwise, it is made relative to the passed base path.
| basePath | The base path from which the passed relative path will be based, if the relative part is indeed relative. | |
| relativePath | The relative part of the path. It can actually be fully qualified, in which case it is taken as is. | |
| manager | Pointer to the memory manager to be used to allocate objects. |
| XMLException | If the path is relative and doesn't properly resolve to a file. |
| xercesc::LocalFileInputSource::LocalFileInputSource | ( | const XMLCh *const | filePath, | |
| MemoryManager *const | manager = XMLPlatformUtils::fgMemoryManager | |||
| ) |
This constructor takes a single parameter which is the fully qualified or relative path.
If it is fully qualified, it is taken as is. If it is relative, then it is completed relative to the current working directory (or the equivalent on the local host machine.)
The completed path will become the system id of this input source. The constructors don't take any public id for local files, but you still set them via the parent class' setPublicId() method of course.
| filePath | The relative or fully qualified path. | |
| manager | Pointer to the memory manager to be used to allocate objects. |
| XMLException | If the path is relative and doesn't properly resolve to a file. |
| xercesc::LocalFileInputSource::~LocalFileInputSource | ( | ) |
| virtual BinInputStream* xercesc::LocalFileInputSource::makeStream | ( | ) | const [virtual] |
This method will return a binary input stream derivative that will parse from the local file indicatedby the system id.
Implements xercesc::InputSource.


{% extends "error_layout.html" %} {% block title %}{{ _('pyClanSphere Maintenance Mode') }}{% endblock %} {% block body %}
This pyClanSphere instance is in maintenance mode right now. Plase wait until the administrator reopens the site.
{% endblock %}


{% extends "global/Page.html" %} {% load otree static %} {% block title %}
Here we explain the visual information of your group (the way it will be displayed on the screen). This information will be useful for the subsequent parts of the experiment. In this part you will also make a decision together with the other participants assigned to your group: you will choose a name for your group. This is explained as follows:
{% if player.given_type == 1 %}
You have been assigned to group ● (internal symbol)
and your appearance is ◯ (external symbol).
There are {{ Constants.total_circles }} players in your group●, you included.
There are {{ Constants.total_triangles }} players in group ▲.
Each player in your group will be displayed on the screen using the following image:
In the chat box on the right hand side you can communicate with the other participants in group ●
and choose a name for your group, by clicking on the button with the name you prefer as a group.
To choose a name, all {{ Constants.total_circles }} players in your group must click on the same button.
{% elif player.given_type == 5 %}
You have been assigned to group ▲ (internal symbol)
and your appearance is △ (external symbol).
There are {{ Constants.total_triangles }} players in your group▲, you included.
There are {{ Constants.total_circles }} players in group ●.
Each player in your group will be displayed on the screen using the following image:
In the chat box on the right hand side you can communicate with the other participants in group ▲
and choose a name for your group, by clicking on the button with the name you prefer as a group.
To choose a name, all {{ Constants.total_circles }} players in your group must click on the same button.
{% endif %}
In the chat box below, you will be labeled as Player {{ player.role }}. It is not allowed to use any
offensive language. And to maintain anonymity, it is not allowed to send any information that can be used
by the other participants to identify who you are.
Write on the chat box to communicate with the other players in your group.
Click on the button with the name chosen by your group.
{% if player.given_type == 1 %}


The game of things
{{ message }}
Player ID: {{ userId }}
Player name: {{ username }}
Room ID: {{ roomId }}


SARVA 3.0
SAEON was appointed by DST in July 2015 to manage and execute work in relation to the South African Risk and Vulnerability Atlas (SARVA). As part of this task, SAEON has now updated the web-based resources available to practitioners in the field, and made significant progress in sourcing or producing new and more detailed datasets, providing updated tools for Impact Assessment, and linking SARVA to other relevant systems in the landscape, such as the National Climate Change Response Database managed by DEA, and the Declared Disasters database provided by NDMC.
SARVA is integrated into the SAEON Open Data Platform (ODP), and as a result shares metadata and data directly with other initiatives, such as SASDI, the NSPDR, BioEnergy Atlas, OCIMS, and similar.
SARVA is primarily funded by the Department of Science and Technology, with contributions to specific ecxtensions from DEA.
SAEON directly collaborates with a sizable number of research and government institutions - largely to enable access to relevant datasets. We have formal collaboration agreements with CSIR, SAWS, DEA, DRDLR, and the Department of Health, and also collaborate with SALGA, NDMC, SANBI, ARC, DWS, DAFF, and other government institutions whenever possible.
The SARVA project is executed by the SAEON Ulwazi Node, largely housed in Cape Town, with some team members based in Pretoria at the SAEON National Office. SAEON Ulwazi has 22 members, spread between five areas of competence.
- Decision and Policy Support
- Systems Development and Delivery
- Science Engagement and Data Product Development
- Networks, Hardware, Security, and Connectivity
- Data Curation and Research Data Infrastructure Management
All work is funded for the benefit of the public at large and our work is shared with open licenses.


 Currently, only the Balance Sheet of the company is available. Income Statement and Cash Flow will be added in the next update.
Data from: finance.yahoo.com


A more complex example that shows how to work with a business N-Layer application in its standard form (interface, business logic, persistence).
Let's see what kind of mess we have to fix here.
As any N-Layer application worth the name, we find three separate parts:
To simplify the example, we'll assume there's one interface class, one logic class and one persistence class:
TODO Poner aquí el control de pestañas...
We'll start the cleanup by simplifying code.
As with the previous example, the first step is removing all error handling code. In this case, the uppermost layer (interface) will handle everything. All other layers can let exceptions propagate upwards.
If they need to abort execution early or send a specific error message, it's fine to let them throw an exception, it will be caught later anyways.
TODO Poner aquí el control de pestañas...
Now that the code is ready, we can build the composition.
Both the business logic and persistence layers are finished. The only change that remains is add a Try call in the interface layer to handle all exceptions thrown from below.
namespace Example.UI { public class AddFlightConnection { string origin, destination; int seats; public void Execute() { Try.This(AskForOrigin) .Then(ValidateIATACode) .Then(AskForDestination) .Then(ValidateIATACode) .Then(AskForSeats) .Otherwise(ReportError) .Then(Create) .Then(Store) .Otherwise(ReportError) .Then(ShowConfirmation) .Now(); } private string AskForOrigin() { Console.WriteLine("Enter IATA code for origin airport:"); return origin = Console.ReadLine(); } private string AskForDestination() { Console.WriteLine("Enter IATA code for destination airport:"); return destination = Console.ReadLine(); } private int AskForSeats() { Console.WriteLine("Enter number of seats per connection:"); seats = int.Parse(Console.ReadLine()); } private void ValidateIATACode(string code) { if(code.Length != 3) throw new Exception($"Invalid IATA code entered: {code}"); } private FlightConnection Create() { return new FlightConnection(origin, destination, seats); } private void Store(FlightConnection flight) { new Example.Business.AddConnection().Execute(flight); } private void ShowConfirmation() { Console.WriteLine("Successfully stored flight connection."); } private void ReportError(Exception error) { Console.WriteLine($"Error: {error.Message}"); } } }
The final version of the interface layer can be cleared a bit by removing the global variables. That will require the use of Tuples, and is explained in the "More Features" guide available in the main Docs & Reference page.
You have learnt how to adapt a more complex application to use DotNet.Safe. If you're up for it, there is more sweet knowledge this way.


Comments can be added in two ways.
Adding Comments with the Observing Tool
- Comments can be added with the Observing Tool by locating the observation and adding comments to the Observing Log
Component.
- The comments in the Observing Log component are dataset comments. The comment that shows up in the normal
Plan view is the dataset comment for the first dataset comment in a configuration of the instrument.
Adding Comments from the Web Application
- Comments can also be added from the web application using the browser interface.
- In the Plan View, Observation View, or Program View a comment will be the shown right most column.
- The first column has the Actions. One action is a link named comment. Type the comment into the comment column
and select the comment link. This will update the database without redrawing the
web page. I'm working on a way to make the action of saving more obvious.


From web development to machine learning and computer vision applications.
Freelance work using a great variety of technologies.
Use of biomedical signals for control systems.
Active member of the Biomedical Computer Vision Research group @Universidad de los Andes
Development of a 3DOF robot, where it's movement depends on the muscular activation of the forearm.
Willy can move forward, rotate on his own axis and move his arms.
An automatic mandible segmentation algorithm was proposed for the 2015 MICCAI challenge: Head and neck Auto Segmentation Challenge database. With the use of 3D template matching and geodesic dilation a Dice index of 0.80486 was obtained. The left image shows the segmentation produced by the algorithm, and the right one is the original mask.
A neural network approach is proposed for dealing with this task, using CROHME 2016 dataset. Where a new architecture was developed and obtained a 78.4% test accuracy.
Looking forward to develop your projects?


BASE
1
2
3
What is your item called?
Select a category for your item
Shoes
Clothes
Technology
Set the pricing of your item
Starting Offer
$
Buy it Now
$
What is the condition of your item?
New
Used
Describe your item.
Prev
Next


{% extends 'base.html' %} {% block body %}
This will unsubscribe you from all sequences that you are signed up for
Unsubscribe
Sorry, we couldn't find your signup. Did you sign up with a different email address?


I'm an Electrical Engineer passionate about FPGAs, hardware design, embedded systems, fault-tolerant systems, domain-specific architectures, digital signal/image processing and machine learning.
I hold a BSEE from the Federal University of Rio Grande do Norte (UFRN) and I'm currently pursuing a MSEE at the State University of Campinas (UNICAMP).
My BS final project was the implementation of a 5-stage pipeline RV32I RISC-V CPU Core written in VHDL.
I did my internship at the National Institute for Space Research, working at the ARGOS-II Environmental Data Collector Cubesat payload.
My previous job was as a contractor at Motorola working on image processing for smartphone cameras.
I'm currently working as a contractor software engineer at Wind River via Encora.
mpv Resampling - A sequel in the making
ImageMagick Resampling - When doing it with mpv isn't enough...
Machine Learning Super-Resolution Part 2 - Can We Beat Waifu2x?
Gamma Correction - Why You Should Care
Domain-Specific Accelerators - A Short Preface
Machine Learning Super-Resolution - An Introduction to AI Upsampling
Building a Pipelined CPU Core - An Introduction to Computer Architecture and Digital Design
Open Hardware and RISC-V - A Brief Introduction
Interning at the Brazilian National Institute for Space Research
Keyframe Encoding Comparison - Numerically Evaluating Different Popular Video Encoders on Anime Content
Digital Image Processing - University Assignments
Assigned to work alongside Wind River on their distributed edge cloud infrastructure.
Assigned to work alongside Motorola on ISP pipelines, imaging algorithms and auto-focus for camera systems in Android devices.
Assigned primarily at developing and maintaining the testbench of a SBCDA (Brazilian Environmental Data Collection System) Cubesat compatible payload, including a hardware in the loop test-routine
and the required code to emulate an on-board-computer utilising an x86 Workstation running Matlab as a master, an Arduino Due as an I²C bridge and a Rohde&Schwarz SMBV100A Vector Signal Generator.
Secondary tasks varied from firmware development to brainstorming possible engineering solutions or improvements to the Environmental Data Collector as a whole,
which included changes to the dedicated decoding hardware in the Microsemi Smartfusion 2 FPGA, or to the communication protocols handled by the ARM Cortex-M3 based microcontroller subsystem running FreeRTOS.
Updating internal and external use documentation was also part of the daily routine, on top of sometimes interacting with external teams integrating our system alongside their on-board-computers.
I'm currently studying super-resolution CNNs and ML optimisation techniques for fast inference.
My grad level classes included internet of things, digital signal processing and machine learning.
Developed Maestro, a 5-stage pipeline in-order RV32I RISC-V core written entirely in VHDL for academic purposes. Intel Quartus Prime and ModelSim were utilised for synthesis and verification, and a Cyclone V FPGA was used for testing purposes. The core is part of my bachelor’s degree and can be found at https://riscv.org/risc-v-cores.
Conducted a performance and picture quality evaluation of different upscaling algorithms supported by the popular video player mpv, which includes a wide variety of choices, from polynomial interpolation to convolutional neural networks based shaders. The study was conducted for a Digital Image Processing subject and can be found at https://artoriuz.github.io/mpv_upscaling.html.
Undergrad classes included digital and analogue electronics, power systems, control systems, communication systems, embedded systems and artificial intelligence.
SP-VDSR is a shallow convolutional neural network based on both VDSR and ESPCN. The rationale was making VDSR faster employing ESPCN's depth-to-space sub-pixel convolution to upsample the residuals. The trained network is relatively shallow with only 5 convolutional layers of 8 kernels each.
View Project
Maestro is a 5 stage pipeline implementation of the RV32I ISA strongly inspired by David Patterson's and John Hennessy's Computer Organization and Design RISC-V Edition.
The project is entirely academic, it's written in VHDL in a beginner-friendly way so computer architecture students can also learn about hardware design.
The core is very good at demonstrating how to build simple workarounds for problems encountered within pipelined in-order CPU cores such as hazards and stalls.
The environmental data collector is a Cubsat-compatible payload capable of decoding up to 12 ARGOS-2 PTT signals.
During my internship I was in charge of developing a way of simulating the system to catch bugs and evaluate its performance. The testbench was composed of a hardware in the loop test-routine
and the required code to emulate an on-board-computer utilising an x86 Workstation running Matlab as a master, an Arduino Due as an I²C bridge and a Rohde&Schwarz SMBV100A Vector Signal Generator.
Conducted a performance and picture quality evaluation of different upscaling algorithms supported by the popular video player mpv, which includes a wide variety of choices, from polynomial interpolation to convolutional neural-network based shaders and measurements such as SSIM and PSNR.
View Project
Motus Camera is a movement detection surveillance program written in C++ using OpenCV.
Upon movement detection, the recording is then written to disk encoded into an AVC clip until the scene becomes still.
Magnetic lock prototype controlled by a PIC16 with a numpad made of push buttons and code wittren in ASM.
View ProjectMemory game implemented using Qsys, NIOS II soft core and a Cyclone II FPGA.
View Project


Shortcut to the WebHDFS OPEN command.
hdfs_open(path, handler, offset_bytes = NULL, length_bytes = NULL, buffer_size = NULL, user = get_user(), return_type = get_return_type())
| path | Character containing file system path |
|---|---|
| handler | Function name to be used to load data from WebHDFS. It is
incumbent on the user for this function to be available in the current
session, and for the function to handle the type of data referenced by
|
| offset_bytes | The starting position to be processed, in bytes. Default (NULL) means start from the beginning of the file. |
| length_bytes | The number of bytes to be processed. Default (NULL) means the entire file will be read. |
| buffer_size | The size of the buffer to be used in transferring data. |
| user | Character username to use in WebHDFS operation. If not provided,
|
| return_type | character string. See |
data.frame
(or other requested type) containing content from
the requested file path
http://hadoop.apache.org/docs/stable/hadoop-project-dist/hadoop-hdfs/WebHDFS.html#Open_and_Read_a_File for documentation of WebHDFS OPEN command and its parameters.
# NOT RUN { library(data.table) dat <- hdfs_open("/data/dummy.csv", handler = "fread") # }


This is a test of progress finished callback ordering in relation to frame loader callbacks. It is only useful inside the regression test tool.


| Syntax::Compiler::ICompiler | Used by a plugin to retrieve basic values from the main compiler |
| Syntax::Compiler::INodeCompiler | This will actually compile the data from the xml file into its binary equivalent |
| Syntax::Compiler::INodeHandler | Interface a plugin has to implement to handle an xml tag in the source xml |


What is this?
FindFreeCourses is a search engine to find free eductional content for every topic a person would need. It searches and indexes many different sites to give the best results tailored to the search. You can search any topic and get the best results back! No excuses; start learning today!
Why?
There are tons of free (and paid) content out on the internet today. Provided by colleges, corporations, teachers, industry experts.. etc. This content is very spread out across multiple websites; there is no search engine. We provide that middleware to all the resources out there.


The Spectral Event is summit bringing together artists, technologists, and other fatidical minds August 5-6 in New Rochelle, NY. It will be a weekend of talks, workshops, performances and parties with practitioners and theorists working in creative technology, interactive media, VR/AR, design, urban planning, data science, and more. The goal is to bring a diverse cast of participants together to share ideas and spark discussions about the role that technology and new media can play in the process of building future communities.
Hosted by IDEA New Rochelle and The New Rochelle Downtown BID, the Spectral Event is a celebration of the burgeoning developments that are underway to transform downtown New Rochelle into an arts and technology district. Talks, panels, and performances by The Spectral Event Fellows including: Matt Romein, Sheetal Prajapati, Jason Sigal, Caroline Sinders, Kat Sullivan, Sam Tarakajian, Marco Antonio Castro, Nitzan Bartov, David Lobser, Todd Bryant, Stephanie Riggs, Allison Burtch, Allison Parrish, Sam Lavigne, Adrian Sas, Lisbeth Kaufman, Lajune MacMillan, Arwa Mahdawi, Pamela Liou, Cassie Tarakajian, Michele Cortese, Gabe Barcia-Colombo, Javier Molina and many more…
Saturday the 5th of August and Sunday the 6th of August there will be artist talks and panel discussions that are open to the public. They will be at the Ozzy Davis Theater at the New Rochelle Public Library beginning at 10:30 am each day. Please join us by taking the metro-north train to New Rochelle (the library is just a short walk from the station). The even classes and workshops have a limited number of spaces, and the signup is available at Gaddy Hall at Monroe College on a first come first serve basis to ticketed participants.
The Spectral Event will be August 5-6 (the first weekend of August).
All events and activities will be held at various locations throughout downtown New Rochelle, within walking distance from the Metro-North station.
We have a roster of fellows who are preparing an array of talks, discussions, workshops, and performances. We are also planning a program of parties, walking tours, movie-nights, water-fights, and more!
registration is closed.
The first definition of the word "spectral" in Webster's Dictionary is: "of, relating to, or suggesting, a specter (ghost)." The second is "of, relating to, or made by a spectrum." Our "Spectral" refers to both of these senses.
We talk about specters as being spooky characters from the past, but we see no reason that ghostly visions shouldn't come to us from the future as well. When we try to bring about something that has never existed before, there is a period during which this new entity is still virtual, existing only as ghostly outlines in the imagination. We want our summit to bring forth new ideas into the world, and so we use the word spectral in this sense.
The Spectral Event is intended to bring us together to imagine how technology and art can shape new communities. Making a new community is a collective effort to focus the energies a diverse group of people as a prism does to the spectrum of visible light.


Before Change
raise ImportError("You need to install numpy manually, e.g., by running `pip install numpy`.")
use_cython = False
if use_cython:
try:
from Cython.Distutils import build_ext
except ImportError:
raise ImportError("You need to install Cython manually if you want to install using Cython, e.g., by running `pip install cython`.")
cmdclass = {}
ext_modules = []
if use_cython:
ext_modules += [
After Change
cmd_class["build_ext"] = build_ext
suffix = "pyx"
ext_modules.append(Extension(
"scanpy.cython.utils_cy",
["scanpy/cython/utils_cy." + suffix],
include_dirs=include_dirs,
))
req_path = Path("requires.txt")
if not req_path.is_file():


Just Budge It
Free Budgeting Tool
Income
Add Field
Delete Field
Total:
Expenses
Add Field
Delete Field
Total:
Difference
Total Income:
Main Income:
Total Expenses:
Main Expense:
Difference:
Alpha
This is only an Alpha version. None of your information is saved. Please enjoy this site responsibly.


| Home | Libraries | People | FAQ | More |
Every property tree node models the ReversibleSequence concept, providing access
to its immediate children. This means that iterating over a ptree
(which is the same as its root node - every ptree
node is also the subtree it starts) iterates only a single level of the hierarchy.
There is no way to iterate over the entire tree.
每一个属性树节点都符合可逆序列概念，提供对其直接子节点的访问。这意味着遍历一个
ptree
(与根节点一样
- 每个 ptree
节点同时也是从它开始的子树)只是遍历单个层级。
没有方法直接遍历整棵树。
It is very important to remember that the property sequence is not ordered by the key. It preserves the order of insertion. It closely resembles a std::list. Fast access to children by name is provided via a separate lookup structure. Do not attempt to use algorithms that expect an ordered sequence (like binary_search) on a node's children.
有一点很重要必须要记住，属性序列*并不是*按其键值排序的。它保留了插入的顺序。 它更接近于 std::list。按名字对子节点的快速访问，是通过一个独立的查找结构来提供的。 不要试图对一个节点的子节点使用那些要求有序序列的算法(如 binary_search)。
There may be multiple children with the same key value in a node. However,
these children are not necessarily sequential. The iterator returned by find
may refer to
any of these, and there are no guarantees about the relative position of the
other equally named children.
一个节点中可能会有多个子节点带有相同的键值。但是这些子节点间是没有先后顺序的。
find
所返回的迭代器可能指向它们中的任意一个，而且对于其它相同名字的
子节点的相对位置，也是没有保证的。


deep learning
Contents
5.7. deep learning#
This note covers miscellaneous deep learning, with an emphasis on different architectures + empirical tricks.
See also notes in 📌 unsupervised learning, 📌 disentanglement, 📌 nlp, 📌 transformers
5.7.1. top-performing nets#
LeNet (1998)
first, used on MNIST
AlexNet (2012)
landmark (5 conv layers, some pooling/dropout)
ZFNet (2013)
fine tuning and deconvnet
VGGNet (2014)
19 layers, all 3x3 conv layers and 2x2 maxpooling
GoogLeNet (2015)
lots of parallel elements (called Inception module)
Msft ResNet (2015)
very deep - 152 layers
connections straight from initial layers to end
only learn “residual” from top to bottom
Region Based CNNs (R-CNN - 2013, Fast R-CNN - 2015, Faster R-CNN - 2015)
object detection
Generating image descriptions (Karpathy , 2014)
RNN+CNN
Spatial transformer networks (2015)
transformations within the network
Segnet (2015)
encoder-decoder network
Unet (Ronneberger, 2015)
applies to biomedical segmentation
Pixelnet (2017) - predicts pixel-level for different tasks with the same architecture - convolutional layers then 3 FC layers which use outputs from all convolutional layers together
Squeezenet
Yolonet
Wavenet
Densenet
NASNET
5.7.2. basics#
basic perceptron update rule
if output is 0, label is 1: increase active weights
if output is 1, label is 0: decrease active weights
perceptron convergence thm - if data is linearly separable, perceptron learning algorithm wiil converge
transfer / activation functions
sigmoid(z) = \(\frac{1}{1+e^{-z}}\)
Binary step
TanH (preferred to sigmoid)
Rectifier = ReLU
Leaky ReLU - still has some negative slope when <0
rectifying in electronics converts analog -> digital
rare to mix and match neuron types
deep - more than 1 hidden layer
regression loss = \(\frac{1}{2}(y-\hat{y})^2\)
classification loss = \(-y \log (\hat{y}) - (1-y) \log(1-\hat{y})\)
can’t use SSE because not convex here
multiclass classification loss \(=-\sum_j y_j \ln \hat{y}_j\)
backpropagation - application of reverse mode automatic differentiation to neural networks’s loss
apply the chain rule from the end of the program back towards the beginning
\(\frac{dL}{d \theta_i} = \frac{dL}{dz} \frac{\partial z}{\partial \theta_i}\)
sum \(\frac{dL}{dz}\) if neuron has multiple outputs z
L is output
\(\frac{\partial z}{\partial \theta_i}\) is actually a Jacobian (deriv each \(z_i\) wrt each \(\theta_i\) - these are vectors)
each gate usually has some sparsity structure so you don’t compute whole Jacobian
pipeline
initialize weights, and final derivative (\(\frac{dL}{dL}=1\))
for each batch
run network forward to compute outputs at each step
compute gradients at each gate with backprop
update weights with SGD
5.7.3. training#
vanishing gradients problem - neurons in earlier layers learn more slowly than in later layers
happens with sigmoids
dead ReLus
exploding gradients problem - gradients are significantly larger in earlier layers than later layers
RNNs
batch normalization - whiten inputs to all neurons (zero mean, variance of 1)
do this for each input to the next layer
dropout - randomly zero outputs of p fraction of the neurons during training
like learning large ensemble of models that share weights
2 ways to compensate (pick one)
at test time multiply all neurons’ outputs by p
during training divide all neurons’ outputs by p
softmax - takes vector z and returns vector of the same length
makes it so output sums to 1 (like probabilities of classes)
tricks to squeeze out performance
ensemble models
(stochastic) weight averaging can help a lot
test-time augmentation
this could just be averaging over dropout resamples as well
gradient checkpointing (2016 paper)
10x larger DNNs into memory with 20% increase in comp. time
save gradients for a carefully chosen layer to let you easily recompute
5.7.4. CNNs#
kernel here means filter
convolution G- takes a windowed average of an image F with a filter H where the filter is flipped horizontally and vertically before being applied
G = H \(\ast\) F
if we do a filter with just a 1 in the middle, we get the exact same image
you can basically always pad with zeros as long as you keep 1 in middle
can use these to detect edges with small convolutions
can do Guassian filters
1st-layer convolution typically sum over all color channels
1x1 conv - still convolves over channels
pooling - usually max - doesn’t pool over depth
people trying to move away from this - larger strides in conversation layers
stacking small layers is generally better
most of memory impact is usually from activations from each layer kept around for backdrop
visualizations
layer activations (maybe average over channels)
visualize the weights (maybe average over channels)v
feed a bunch of images and keep track of which activate a neuron most
t-SNE embedding of images
occluding
weight matrices have special structure (Toeplitz or block Toeplitz)
input layer is usually centered (subtract mean over training set)
usually crop to fixed size (square input)
receptive field - input region
stride m - compute only every mth pixel
downsampling
max pooling - backprop error back to neuron w/ max value
average pooling - backprop splits error equally among input neurons
data augmentation - random rotations, flips, shifts, recolorings
siamese networks - extract features twice with same net then put layer on top
ex. find how similar to representations are
5.7.5. RNNs#
feedforward NNs have no memory so we introduce recurrent NNs
able to have memory
truncated - limit number of times you unfold
\(state_{new} = f(state_{old},input_t)\)
ex. \(h_t = tanh(W h_{t-1}+W_2 x_t)\)
train with backpropagation through time (unfold through time)
truncated backprop through time - only run every k time steps
error gradients vanish exponentially quickly with time lag
LSTMS
have gates for forgetting, input, output
easy to let hidden state flow through time, unchanged
gate \(\sigma\) - pointwise multiplication
multiply by 0 - let nothing through
multiply by 1 - let everything through
forget gate - conditionally discard previously remembered info
input gate - conditionally remember new info
output gate - conditionally output a relevant part of memory
GRUs - similar, merge input / forget units into a single update unit
5.7.6. graph neural networks#
Theoretical Foundations of Graph Neural Networks
inputs are graphs
e.g. molecule input to classification
one big study: a deep learning appraoch to antibiotic discovery (stokes et al. 2020) - using GNN classification of antibiotic resistance, came up with 100 candidate antibiotics and were able to test them
e.g. traffic maps - nodes are intersections
invariances in CNNs: translational, neighbor pixels relate a lot more
simplest setup: no edges, each node \(i\) has a feature vector \(x_i\) (really a set not a graph)
X is a matrix where each row is a feature vector
note that permuting rows of X shouldn’t change anything
permutation invariant: \(f(PX) = f(X)\) for all permutation matrices \(P\)
e.g. \(\mathbf{P}_{(2,4,1,3)} \mathbf{X}=\left[\begin{array}{llll}0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ 1 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0\end{array}\right]\left[\begin{array}{lll}- & \mathbf{x}_{1} & - \\ - & \mathbf{x}_{2} & - \\ - & \mathbf{x}_{3} & - \\ - & \mathbf{x}_{4} & -\end{array}\right]=\left[\begin{array}{lll}- & \mathbf{x}_{2} & - \\ - & \mathbf{x}_{4} & - \\ - & \mathbf{x}_{1} & - \\ - & \mathbf{x}_{3} & -\end{array}\right]\)
ex. Deep Sets model (zaheer et al. ‘17): \(f(X) = \phi \left (\sum_k \psi(x_i) \right)\)
permutation equivariant: \(f(PX) = P f(X)\) - useful for when we want answers at the node level
graph: augment set of nodes with edges between them (store as an adjacency matrix)
permuting permutation matrix to A requires operating on both rows and cols: \(PAP^T\)
permutation invariance: \( f\left(\mathbf{P X}, \mathbf{P A P}^{\top}\right)=f(\mathbf{X}, \mathbf{A})\)
permutation equivariance: \(f\left(\mathbf{P X}, \mathbf{P A P}^{\top}\right)=\mathbf{P} f(\mathbf{X}, \mathbf{A})\)
can now write an equivariant function that extracts features not only of X, but also its neighbors: \(g(x_b, X_{\mathcal N_b})\)
tasks: node classification, graph classification, link (edge) prediction)
3 flavors of GNN layers for extracting features from nodes / neighbors: simplest to most complex
message-passing actually passes vectors to be sent across edges
previous approaches map on to gnns well
GNNs explicitly construct local features, much like previous works
local objectives: features of nodes i and j should predict existence of edge \((i, j)\)
random-walk objectives: features should be similar if i and j co-occur on a short random walk (e.g. deepwalk, node2vec, line)
similarities to NLP if we think of words as nodes and sentences as walks
we can think of transformers as fully-connect graph networks with attentional form of GNN layers
one big difference: positional embeddings often used, making the input not clearly a graph
these postitional embeddings often take the form of sin/cos - very similar to DFT eigenvectors of a graph
spectral gnns
operate on graph laplacian matrix \(L = D - A\) where \(D\) is degree matrix and \(A\) is adjacency matrix - more mathematically convenient
probabilistic modeling - e.g. assome markov random field and try to learn parameters
this connects well to a message-passing GNN
GNN limitations
ex. can we tell whether 2 graphs are isomorphic - often no?
can make GNNs more powerful by adding positional features, etc.
can also embed sugraphs together
continuous case is more difficult
geometric deep learning: invariances and equivariances can be applied generally to get a large calss of architectures between convolutions and graphs
5.7.7. misc architectural components#
coordconv - break translation equivariance by passing in i, j coords as extra filters
deconvolution = transposed convolution = fractionally-strided convolution - like upsampling
<IP_ADDRESS>. top-down feedback#
-
neurons in the feedback hidden layers update their activation status to maximize the confidence output of the target top neuron
Top-Down Neural Attention by Excitation Backprop | SpringerLink (2017)
top-down attention maps by extending winner-take-all (WTA) to probabilistic maps
Modeling visual attention via selective tuning - ScienceDirect (1995)
original WTA paper provides only binary maps
Bottom-Up and Top-Down Reasoning with Hierarchical Rectified Gaussians (2016)
Beyond Skip Connections: Top-Down Modulation for Object Detection (shrivastava…malik, gupta, 2017)
Learning to Combine Top-Down and Bottom-Up Signals in Recurrent Neural Networks with Attention over Modules (mittal…bengio, 2020)
Very similar — each layer passes attention (1) to next layer (2) to itself (3) to previous layer
Fast and Slow Learning of Recurrent Independent Mechanisms (madan…bengio, 2021)
Inductive Biases for Deep Learning of Higher-Level Cognition (goyal & bengio, 2021)
Neural Networks with Recurrent Generative Feedback (huang…tsao, anandkumar, 2020)
Deconvolutional Generative Model DGM - hierarchical latent variables capture variation in images + generate images from a coarse to fine detail using deconvolution operations
A generative vision model that trains with high data efficiency and breaks text-based CAPTCHAs (vicarious, 2016)
bayesian model + crf on latents breaks captchas
Combining Top-Down and Bottom-Up Segmentation (2008) (pre-DNNs)
Bottom-up segmentation: group chunks of image into ever-larger regions based on e.g. texture similarity
Top-down segmentation: find object boundaries based on label info
Perceiver: General Perception with Iterative Attention (2021)
-
Very similar to our idea - they have deconvolved feedback to earlier layers
Architecture’s weird, tho - feedback only goes back a few layers
Extremely applied - their result is “we beat SOTA by 3%”
Attentional Neural Network: Feature Selection Using Cognitive Feedback (2014)
5.7.8. neural architecture search (NAS)#
One Network Doesn’t Rule Them All: Moving Beyond Handcrafted Architectures in Self-Supervised Learning (girish, dey et al. 2022) - use NAS for self-supervised setting rather than supervised
A Deeper Look at Zero-Cost Proxies for Lightweight NAS · The ICLR Blog Track (white…bubeck, dey, 2022)
tl;dr A single minibatch of data is used to score neural networks for NAS instead of performing full training.
5.7.9. misc#
adaptive pooling can help deal with different sizes
NeRF: Representing Scenes as Neural Radiance Fields for View Synthesis
given multiple views, generate depth map + continuous volumetric repr.
dnn is overfit to only one scene
inputs: a position and viewing direction
output: for that position, density (is there smth at this location) + color (if there is smth at this location)
then, given new location / angle, send a ray through for each pixel and see color when it hits smth
Implicit Neural Representations with Periodic Activation Functions
similar paper
optimal brain damage - starts with fully connected and weeds out connections (Lecun)
tiling - train networks on the error of previous networks
Language model compression with weighted low-rank factorization (hsu et al. 2022) - incorporate fisher info of weights when compressing via SVD (this helps preserve the weights which are important for prediction)
can represent a full-rank weight matrix as a product of low-rank matrices, e.g. to get rank r repr of 10x10 matrix, make it a product of a 10xr and an rx10 matrix
people often use SVD to posthoc compress a DNN


{# This is the default Sphinx theme used by gbpBuild. It is a modified version of the 'Cloud' Sphinx theme with some additions inspired by the 'psi' theme. Please see: http://cloud-sptheme.readthedocs.io/en/latest/cloud_theme.html https://github.com/psi4/sphinx-psi-theme for more details. #}


ew.db.couchdb/src/main/java/com/fourspaces/couchdb/ViewResults.java
/* Copyright 2007 Fourspaces Consulting, LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package com.fourspaces.couchdb; import java.util.ArrayList; import java.util.List; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; /** * The results of a view request is just a specialized Document object. * You can use ViewResults to retrieve information about the results (such as the * number of rows returned). * <p> * The ViewResults document contains a JSONArray named "rows". This JSON array contains * further sub-Documents. These documents include the _id and _rev of the matched Documents as * well as any other fields that the View function returns -- it is not the full Document. * <p> * In order to retrieve the full document, you must call database.getDocument(id). * * @author mbreese * */ public class ViewResults extends Document { Log log = LogFactory.getLog(ViewResults.class); private View calledView; /** * Builds the ViewResults object from the given JSON object. (called only from Database.view()) * This shouldn't be called by user code. * @param calledView * @param obj */ ViewResults(View calledView, JSONObject obj) { super(obj); this.calledView=calledView; } /** * Retrieves a list of documents that matched this View. * These documents only contain the data that the View has returned (not the full document). * <p> * You can load the remaining information from Document.reload(); * * @return List of Document objects. * @throws JSONException JSON Formatting Exception */ public List<Document> getResults() throws JSONException { JSONArray ar = getJSONObject().getJSONArray("rows"); List<Document> docs = new ArrayList<Document>(ar.length()); for (int i=0 ; i< ar.length(); i++) { // log.info(ar.getString(i)); if (ar.get(i)!=null && !ar.getString(i).equals("null")) { Document d = new Document(ar.getJSONObject(i)); d.setDatabase(database); docs.add(d); } } return docs; } /** * The new that created this results list. * @return View object */ public View getView() { return calledView; } }


I was born in Mombasa but later moved to Nairobi.I went through primary school then later I joined
Utumishi Academy for my High school studies.
Since my childhood i have loved technology and am so passionate
about programming.I chose to learn programming in Moringa so that I could be a source of help to the society in matters
relating to technology. I love swiming and playing video games during my leisure time.
Here are some projects that i have done:


Connect
Main
BPM
Delay
Presets
On/Off static light:
BPM:
Delay:
120 BPM
150 BPM
180 BPM
200 BPM
220 BPM


--- title: Welcome to Xiu's personal website! layout: page --- Please explore this pathway level information card of me using your mouse! image/svg+xml Hello! Learn more about Notch Signaling Pathway My old blog My current blog B.E. Huazhong University of Science and Technology 10' Bioinformatics Database, MySQL Intern. Shanghai Center for Bioinformation Technology Perl, C/C++, Matlab, Java Genomics Statistics China Scholars Council Fellowship 10' HUST Outstanding Student in Academic Performance and Leadership 07-08' HUST Outstanding Graduate 10' Youth Ambassador of Jiangsu China 11-12' R, Bash Script, Html, RMarkdown PhD. Yale University 16' Computational Biology and Bioinformatics Advisor: Prof Hongyu Zhao Hongyu Zhao's Lab Research Publication Interests Facebook Twitter Google Scholar Github RSS Linkedin Curriculum Vitae


Sending Mail
Features of Outgoing Mail
Attachments
Signatures
Sending Mail [top]
How to send email via WebMail
Attachments
To attach files to your email messages, first click the Attach button in the compose screen. A new window will popup to add attachments; click the "Browse" button to select a file from your hard drive. Click "OK" when you have selected the appropriate file attachment. Once files are uploaded, you can check the size of the attachment and choose to delete the file. Multiple attachments are supported; due to security and server-space attachments can be a maximum of<2-10MB in size. For exact size limits contact your administrator.


Warehouse Freightman Raut:
We of the Iron Gate Guild are devoted to safely delivering your cargo--even in wartime! You can leave anything with ous!
"I want to learn a Skill."
Quest