Managed Engines for Advanced Workflows¶
When using just CPU resources, SHAC
is sufficient for most tasks.
However, when more complicated workflows are involved - such as training models and evaluation with Tensorflow, PyTorch or Keras or other such libraries that involve graph based execution and memory management, it is advised to use the Managed Engines detailed here.
There are three engines provided :
Motivation for Managed Engines¶
- Tensorflow / Keras use graphs to generate and train models. These graphs and their scopes need to be managed properly.
- If evaluators are models which run on the GPU, it may not be possible to run more than 1 model at once due to memory constraints.
- It is necessary to provide a simple interface to decide whether GPUs will be used or not.
Note
It is upto the user to utilize the worker_id
parameter to determine the placement of the operations.
The session provided does not wrap the evaluation function in a device, as certain ops may not be available on GPUs.
In the same manner, when using PyTorch, the device is not set by the managed engine. It is the task of
the user to utilize the provided worker_id
in pushing models onto the correct devices.
TorchSHAC¶
This is the most basic managed engine, which only provides a unified interface similar to TensorflowSHAC
and
KerasSHAC
. In term's of functionality, it does not manage memory or graph execution, since PyTorch does not
utilize a graph in a user facing way.
It simply provides a way to determine whether / how many evaluation processs can be started using the max_gpu_evaluators
argument.
As such, when using dynamic execution environments, such as PyTorch
, Tensorflow Eager
or tf.keras
with
Eager Execution enabled, it is suggested to use this backend.
Like SHAC
, the evaluation function will receive 2 inputs :
- Worker ID: Integer id that can be left alone when executing only on CPU or used to determine the GPU id on which the model will be evaluated.
- Parameter OrderedDict: An OrderedDict which contains the (name, value) pairs of the Parameters passed to the engine.
- These are the values of the sampled hyper parameters which have passed through the current cascade of models.
TensorflowSHAC¶
Due to its graph based execution, Tensorflow is the primary candidate to use a managed session.
Unlike the SHAC
and TorchSHAC
engines, an evaluation function using the TensorflowSHAC
engine will receive
3 inputs :
- Tensorflow Session: This session manages a separate graph for each parallel evaluator.
- The scope of all ops inside the evaluation function is the scope of the managed graph.
- It can be used to run all operations inside of the evaluation function.
- Worker Id: An integer id that can be used alongside multiple GPU's to determine which GPU will be used to
- Parameter OrderedDict: An OrderedDict which contains the (name, value) pairs of the Parameters passed to the engine.
- These are the values of the sampled hyper parameters which have passed through the current cascade of models.
Since these graphs are managed by the engine, once the evaluation function has provided a value, the respective graph will be destroyed and resources released automatically by the engine.
KerasSHAC¶
Since Keras is a wrapper over Tensorflow and CNTK which support multiple GPU execution, this wrapper simply
provides a thin wrapper over the TensorflowSHAC
engine. It's primary purpose is to release resources
after the evaluation of the function.
Unlike the SHAC
and TorchSHAC
engines, an evaluation function using the KerasSHAC
engine will receive
3 inputs :
- Tensorflow Session or None: This session manages a separate graph for each parallel evaluator.
- The scope of all ops inside the evaluation function is the scope of the managed graph.
- It can be used to run all operations inside of the evaluation function.
- When using the CNTK backend, this argument will be
None
.
- Worker Id: An integer id that can be used alongside multiple GPU's to determine which GPU will be used to
- Parameter OrderedDict: An OrderedDict which contains the (name, value) pairs of the Parameters passed to the engine.
- These are the values of the sampled hyper parameters which have passed through the current cascade of models.
Since these graphs are managed by the engine, once the evaluation function has provided a value, the respective graph will be destroyed and resources released automatically by the engine.


Class MatrixCellDescriptor
The descriptor that is used to describe one matrix data cell.
Implements
Inherited Members
Namespace: FastReport.Matrix
Assembly: FastReport.OpenSource.dll
Syntax
public class MatrixCellDescriptor : MatrixDescriptor, IFRSerializable
Remarks
The MatrixCellDescriptor class is used to define one data cell of the matrix. The key properties are Expression and Function. To set visual appearance of the data cell, use the TemplateCell property.
The collection of descriptors used to represent the matrix data cells is stored in the MatrixObject.Data.Cells property.
Constructors
MatrixCellDescriptor()
Initializes a new instance of the MatrixCellDescriptor class with default settings.
Declaration
public MatrixCellDescriptor()
MatrixCellDescriptor(String)
Initializes a new instance of the MatrixCellDescriptor class with specified expression.
Declaration
public MatrixCellDescriptor(string expression)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | expression | The descriptor's expression. |
MatrixCellDescriptor(String, MatrixAggregateFunction)
Initializes a new instance of the MatrixCellDescriptor class with specified expression and aggregate function.
Declaration
public MatrixCellDescriptor(string expression, MatrixAggregateFunction function)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | expression | The descriptor's expression. |
| MatrixAggregateFunction | function | The aggregate function. |
MatrixCellDescriptor(String, MatrixAggregateFunction, MatrixPercent)
Initializes a new instance of the MatrixCellDescriptor class with specified expression, aggregate function, and a percent.
Declaration
public MatrixCellDescriptor(string expression, MatrixAggregateFunction function, MatrixPercent percent)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | expression | The descriptor's expression. |
| MatrixAggregateFunction | function | The aggregate function. |
| MatrixPercent | percent | The percent setting. |
Properties
Function
Gets or sets an aggregate function used to calculate totals for this cell.
Declaration
public MatrixAggregateFunction Function { get; set; }
Property Value
| Type | Description |
|---|---|
| MatrixAggregateFunction |
Percent
Gets or sets a value that determines how to calculate the percent value for this cell.
Declaration
public MatrixPercent Percent { get; set; }
Property Value
| Type | Description |
|---|---|
| MatrixPercent |
Methods
Assign(MatrixDescriptor)
Assigns values from another descriptor.
Declaration
public override void Assign(MatrixDescriptor source)
Parameters
| Type | Name | Description |
|---|---|---|
| MatrixDescriptor | source | Descriptor to assign values from. |
Overrides
Serialize(FRWriter)
Serializes the object.
Declaration
public override void Serialize(FRWriter writer)
Parameters
| Type | Name | Description |
|---|---|---|
| FRWriter | writer | Writer object. |


Want to contribute? Is there something wrong?  Make a pull request or something.


Decade in which homes were built
This map randomly places dots within Census Block Groups based on the number of homes built within the area.
Selecting two or more decades
will render dots based on the decade in which homes were built.
Use Ctrl or Cmd to select and deselect values.
Before 1940
1940-1949
1950-1959
1960-1969
1970-1979
1980-1989
1990-1999
After 2000
Color Scheme:


module Puppet
newtype(:port) do @doc = "Installs and manages port entries. For most systems, these entries will just be in /etc/services, but some systems (notably OS X) will have different solutions." ensurable newproperty(:protocols) do desc "The protocols the port uses. Valid values are *udp* and *tcp*. Most services have both protocols, but not all. If you want both protocols, you must specify that; Puppet replaces the current values, it does not merge with them. If you specify multiple protocols they must be as an array." def is=(value) case value when String @is = value.split(/\s+/) else @is = value end end def is @is end # We actually want to return the whole array here, not just the first # value. def should if defined?(@should) if @should[0] == :absent return :absent else return @should end else return nil end end validate do |value| valids = ["udp", "tcp", "ddp", :absent] unless valids.include? value raise Puppet::Error, "Protocols can be either 'udp' or 'tcp', not #{value}" end end end newproperty(:number) do desc "The port number." end newproperty(:description) do desc "The port description." end newproperty(:port_aliases) do desc 'Any aliases the port might have. Multiple values must be specified as an array. Note that this property is not the same as the "alias" metaparam; use this property to add aliases to a port in the services file, and "alias" to aliases for use in your Puppet scripts.' # We actually want to return the whole array here, not just the first # value. def should if defined?(@should) if @should[0] == :absent return :absent else return @should end else return nil end end validate do |value| if value.is_a? String and value =~ /\s/ raise Puppet::Error, "Aliases cannot have whitespace in them: %s" % value.inspect end end munge do |value| unless value == "absent" or value == :absent # Add the :alias metaparam in addition to the property @resource.newmetaparam( @resource.class.metaparamclass(:alias), value ) end value end end newproperty(:target) do desc "The file in which to store service information. Only used by those providers that write to disk." defaultto { if @resource.class.defaultprovider.ancestors.include?(Puppet::Provider::ParsedFile) @resource.class.defaultprovider.default_target else nil end } end newparam(:name) do desc "The port name." isnamevar end end
end


Building(cityMap: CityMap)
The basic unit of simulation in this game. Represents a building and all its attributes. We currently count Road as building as well as PowerLine.


NeutronFile Source Repo
Donate
info
Loading Description...
Compatible with
Description
Screenshot's
This Package Is Open Source
Changelog
Package Info
Name-
Identifier-
Section-
Version-
Size-
Updated-
Loading Description...
Compatible with
This Package Is Open Source
Name-
Identifier-
Section-
Version-
Size-
Updated-
NeutronFile © 2020


Gateway
BOT
31-Dec-18 07:45 AM
[dscrd-hush] <rjanetzek> can you scroll up a little bit
[dscrd-hush] <AkiraX> is it still compiling?
[dscrd-hush] <rjanetzek> i think its broken
[dscrd-hush] <rjanetzek> there is an error message
[dscrd-hush] <rjanetzek> what version of webpack server is used
Operating System: Windows 10 1709 Node Version: v8.9.4 NPM Version: 5.6.0 webpack Version: 3.3.0 webpack-dev-server Version: 3.1.0 This is a bug This is a modification request Code I don't have...
[dscrd-hush] <AkiraX> yes i just found the same info
[dscrd-hush] <AkiraX> how can i check?
[dscrd-hush] <rjanetzek> hmm its 2.7
[dscrd-hush] <rjanetzek> package.json
[dscrd-hush] <AkiraX> i did an npm audit fix --force
[dscrd-hush] <AkiraX> looks like higher version
[dscrd-hush] <rjanetzek> try to not use npm audit fix
[dscrd-hush] <rjanetzek> for now
[dscrd-hush] <AkiraX> i dont think it builds unless i do
[dscrd-hush] <AkiraX> gets alot of warnings
[dscrd-hush] <AkiraX> so what should i do?
[dscrd-hush] <AkiraX> i did the same on windows
[dscrd-hush] <rjanetzek> hmm i worked at that one year ago. dont know the changes that were made since then
[dscrd-hush] <AkiraX> redownload the github and rerun?
[dscrd-hush] <rjanetzek> i would try that
[dscrd-hush] <rjanetzek> warnings are ok
[dscrd-hush] <rjanetzek> errors are bad
[dscrd-hush] <AkiraX> yeah ok
[dscrd-hush] <AkiraX> npm run dev loads with f12 now
[dscrd-hush] <AkiraX> and icons are there in linux
[dscrd-hush] <AkiraX> going to retry in windows
[dscrd-hush] <rjanetzek> hmm then its a thing with the prod build
[dscrd-hush] <AkiraX> let me try to run the prod build now
[dscrd-hush] <AkiraX> i saw there was code to change the \ for prod
[dscrd-hush] <AkiraX> let me show that to you
[dscrd-hush] <AkiraX> its in the .electron-vue webpack.main.config.js
[dscrd-hush] <rjanetzek> hmm i think this is a standard webpack setup
[dscrd-hush] <rjanetzek> it could be that the src property is set the wrong way
[dscrd-hush] <AkiraX> yeah,. just trying to help where i can
[dscrd-hush] <rjanetzek> and webpack cant rewrite that
[dscrd-hush] <AkiraX> im by no means an expert
[dscrd-hush] <rjanetzek> in prdo
[dscrd-hush] <rjanetzek> i wrote that code when i started with vue
[dscrd-hush] <AkiraX> and you guys mainly run linux?
[dscrd-hush] <rjanetzek> developed that on a windows machine
[dscrd-hush] <AkiraX> definitely looks better
[dscrd-hush] <rjanetzek> but i dont work at the project anymore
[dscrd-hush] <rjanetzek> so i dont know what changes were made since then
[dscrd-hush] <AkiraX> icons there
[dscrd-hush] <AkiraX> so it was defintely the fact i did npm audit fix
[dscrd-hush] <AkiraX> but it doesnt load hushd
[dscrd-hush] <AkiraX> im going to try to run npm run build now
[dscrd-hush] <AkiraX> maybe just the fact i did npm audit fix
[dscrd-hush] <rjanetzek> i think the icons will be broken again
[dscrd-hush] <AkiraX> yes
[dscrd-hush] <AkiraX> its true
[dscrd-hush] <AkiraX> broken
[dscrd-hush] <rjanetzek> its something with the patch
[dscrd-hush] <rjanetzek> path to the images
[dscrd-hush] <rjanetzek> static is a special folder
[dscrd-hush] <rjanetzek> but i would need to reed the docs for that


Shelf
Calculus for Scientists and Engineers
Author: William L. Briggs
ISBN:<PHONE_NUMBER>486
Publisher: Pearson
Publish Date: 2012
Price
Condition
Edition
User
$60
Used
12
<EMAIL_ADDRESS>$80
Used
12
<EMAIL_ADDRESS>$100
New
12
elyse@foo.com


UTK Neck & Shoulder Far Infrared Natural Jade Heating Pad is perfectly contoured to relieve muscle tension where people experience it most—the neck and shoulder and back area.
Thanks to the velcro strap on the pad itself, UTK heating pad is designed to stay in place throughout your entire treatment session. Use for just 30 minutes daily (or as recommended by your doctor) to increase blood flow and reduce pain and muscle tension.
| Quantity: | |
| Add to Cart |
Warm–temperature range (103°F~110°F)
Low–temperature range (~120°F)
Medium–temperature range (~130°F)
High–temperature range (140°F~159°F)
UTK provides 12 Months Manufacturer Limited Warranty.
| Product Dimensions: | 28" inches x 25" inches; and approximately 1/2 inches thick |
| Spacing Layout: | 58 Individual Natural Jade Stones for maximum heat transfer and penetration Held securely held in place on a 1 1/2 inches |
| Jade Stone Area: | Approx. 25 x 36 cm; (but pad extends from edge to edge) |
| Power Cord: | One cord 178cm plugged into the electric use, the other cord 79cm connected to the pad |
| Wattage: | 60 watts |
| Standard Voltage: | Universal AC 90-250 Volts ( compatible for AC 90-120 volts, AC 200-250 volts) |
| Item Weight: | 1 kg |
| Shipping Weight: | 2 kg |


A Study of the Mind, Heart and Soul.
| DOSE: T+ 0:00 |
200 mg |
oral |
2C-I |
(powder / crystals) |
| T+ 0:20 |
1.5 g |
smoked |
Cannabis |
(plant material) |
| T+ 1:12 |
1.5 g |
smoked |
Cannabis |
(plant material) |
| T+ 5:00 |
2.0 g |
smoked |
Cannabis |
(plant material) |
Hurahh, Welcome people, this is my adventure with 2c-i. I know this drug really good, and a .2 of a gram just doesn't scare me, anyhow:
t+00h+00m:
I'm getting home from work, it's Thursday night, I don't work on Fridays... hrm, what to do? oh hello baggie of 2c-i. *gobble 0.2g 2c-I*
[Erowid Note: 200 mgs of 2C-I is considered an extremely high dose, see 2C-I Dose Chart]
t+00h+20m:
Time for a bong, gah... well, sorry guys, one bong turned to two, two bongs turned to three, and three turned to twelve... Well, thats one and a half grams by the way...
t+00h+40m:
Well, can you say this is almost impossible. When I focus on my monitor it appears to have a hole in it, completely black where i am focusing, i have to stare at the top right portion of this to see it.
t+01h+12m:
I've been 'peaking' on a scale comparable to a 1-2 hit dosage range for the past... well, since i started to trip, this is so weird. It is not overpowering, or over demanding of my body, or mind. My breathing is normal, temperature normal, pulse normal, I'm pleased with this, and decide to smoke more weed.
Please note that weed's effects while I am on drugs like this is unnoticeable, for me it is purely ceremonial, and I'm smoking Grapefruit, come on, it's just that good *drool*.
t+01h+45m:
Well, a correction, or update, rather on my previous statement. The intensity of my peak has gotten to that of a 0.06g dose of the substance. Colors very beautiful, my fan vibrates, however slightly, and i can see the air or what maybe ions or particulates of some sort or another being blown into my face. However, there is neigh, The fan is 3 feet from me.
My room sports a blue florescent light, it's rather trippy, and adds for a nice effect. The music, John Lennon, is amazing at the moment, however, I have another room that, when you close the access point, is 100% dark, no natural or artificial light. I'll be back.
t+03h+22m:
WOW, What an adventure, if only I could find the words to explain the things I've seen, and imagined, and decided, and oh my god.
------
Here's what happened in a nutshell:
------
+ The Dark inspired strange thoughts, it instilled fear, bravery against that which was not there, it made me hear and see things. At one point I could have sworn that I seen a cat walk right by my feet, i quickly threw the light on, and to avail nothing.
+ The environment inspired great visions, interesting tracers, and 'Blurred' vision, from the tracing black and obscured surroundings that my eyes were showing me. Closing my eyes I can see amazing things, I think of a place, and I can see it. If it's a strong enough thought, I can move about as if I were watching a movie.
+ I also took some time to meditate on recent things in my life, I decided to move to another province during this time. I indeed owe a lot to this drug, the decision has been haunting me for quite some time. I also took the time to get in tune with what I've been dealing with on a daily basis, I feel much better about everything now, I can honestly say.
------
And so yes, That was a crazy time, but now I'm back out here, in my own surrealism. My high hasn't increased by much more than earlier stated, I can tell however that this is going to drag out. Always remember, no 2c-I trip is ever the same, I've had them feel like Ecstasy, with immense rushes of energy. I've had them feel like I just drank 3 cups of coffee, and that was that.
t+05h+00m:
Well, I went for a walk. I /HATE/ being cooped up on substances, I need my roaming freedom. It's late at night as well, and no one but the cops and me are out right now, I stopped and talked to a few of them at Tim Hortons, nice guys, they offered to give me a ride home, but I refused.
On my way home I smoke about another 2 grams of Marijuana. mm mm, so good. As well, I would like to throw in here that I have Scoliosis and 'toking just enables me to mellow out to the point where I don't care to complain about the soreness.
Whee, man, I really shouldn't have taken the opportunity to confront the enforcement like that, Hrm. They were very pleasant people though, they asked me how I was feeling, one had a slight quirk in his eye like he knew something, paranoia? I don't know.  I replied, 'uh... I forget, how about you?' and that line always gets me out of trouble, because its sensible, but perfectly describes my mind set.
t+07h+49m:
I'm going to stop writing until the end of my trip, getting bugged out by the screen. Oh, I'm still wacked out of my tree, same high as previous stated, it would be about as strong as taking... 0.09 or so at once...
t+18h+
Ugh, my head HURTS. I haven't slept, I'm still 'wired'. the high itself lasted almost exactly 12 hours, and went from the plateau peak to quite a hardy headache. That was to be expected, though, as it was morning, and I was outside without my sunglasses. the size of my pupils, and the sun just didn't match. I got to see the sunrise, it was AMAZING, I sat by Lake Ontario for a while, right on the water almost, and was skipping rocks, the splash patterns of the rock were brilliant.
Earlier, almost right after I left you guys, I made a picture, which I lost because my computer crashed. I got so mad :'( god bless notepad, and that annoying popup telling you to save your work :P
Anyhow, I must now encourage you to read the following:
Details on myself as well, so if you want you can further analyze in comparison to racial background, height, weight, gender, or any other classification, you can easily reference without having to contact me.
::Height: 5'6.5'
::Weight: 140 Lbs
::Genealogy: Predominantly Irish, thusly accompanied by Scottish, English, and German.
::Sex: Male
::Age: 19 YOA
Well, ok, we all have our connections, and in some places of the world it is still legal to buy substances for non-abusive purposes. I apologize to anyone who reads this article with an un-open mind, but please do read on.
I have been experimenting with this substance for some time now, almost 2 months. I had purchased 2 grams for personal use. Me(Squeak), Scarface, Britches, Winni, and Sky all had our fun with this substance while I had it.
Me and Scarface, however, being the experienced trippers we are, decided to do some testing of the drug on ourselves. We tested the body's ability to adapt to the drug, and does your body build a resistance? Yes, very much so. Doing it one day, waiting a full 24 hours, and dosing 2x the previous gives the same result on both occasions.
After finding our results with that, we decided to test it's effects in the larger dosages.  Everything from smaller dosages, however intensified. About a week or so after we tried 0.1 of a gram, and it was nuts as well, however I must say my body's reactions to both events was very similar, and the effects from .6 to .1 did not seem to intensify very much at all, I would almost declare that engrossing your dose past .06 is ridiculously unnecessary.
Please note, everyone, my first encounter with this drug was aproximately 5 years ago. A friend of mine from the US, oh yeah, I'm a Canadian btw, told me about it. I did research, a friend of mine placed an order and we had it in 3 days. it's been a while since then, and I'm glad I can still get it. 2,5-dimethoxy,4-iodophenthylamine is my favorite substance, I would have to say. It's calm effects that can rattle me, however irregularly are interesting.
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


NCI(N) = Max j, X[j] ≥ j where NCI(N) is the Network Complexity Index of network N and X[j] is the number of endpoints engaged in an activity


Examples
Currently viewing examples for version 5.x.
Currently viewing examples for version 5.x.
The examples below attempt to demonstrate the myriad ways in which you can use Bootbox.js. Where functionality amongst the dialogs is nearly identical, the example will indicate to which functions the example applies.
Have an example you'd like to add? Open a new issue, or add a pull-request with your example added to this page.
bootbox.alert("This is the default alert!");
bootbox.alert("This is an alert with a callback!", function(){ console.log('This was logged in the callback!'); });
bootbox.alert({
message: "This is an alert with a callback!",
callback: function () {
console.log('This was logged in the callback!');
}
})
Also applies to: Confirm, Prompt, Custom
bootbox.alert({
message: "This is the small alert!",
size: 'small'
});
Requires Bootstrap 3.1.0 or newer.
Also applies to: Confirm, Prompt, Custom
bootbox.alert({
message: "This is the large alert!",
size: 'large'
});
Requires Bootstrap 3.1.0 or newer.
Also applies to: Confirm, Prompt, Custom
bootbox.alert({
message: "This is an alert with additional classes!",
className: 'rubberBand animated'
});
Also applies to: Confirm, Prompt, Custom
bootbox.alert({
message: "This alert can be dismissed by clicking on the background!",
backdrop: true
});
Also applies to: Confirm, Prompt, Custom
bootbox.alert({
message: "This alert uses the Arabic locale!",
locale: 'ar'
});
bootbox.confirm("This is the default confirm!", function(result){ console.log('This was logged in the callback: ' + result); });
Also applies to: Alert, Prompt, Custom
bootbox.confirm({
message: "This is a confirm with custom button text and color! Do you like it?",
buttons: {
confirm: {
label: 'Yes',
className: 'btn-success'
},
cancel: {
label: 'No',
className: 'btn-danger'
}
},
callback: function (result) {
console.log('This was logged in the callback: ' + result);
}
});
Also applies to: Alert, Prompt, Custom
bootbox.confirm({
title: "Destroy planet?",
message: "Do you want to activate the Deathstar now? This cannot be undone.",
buttons: {
cancel: {
label: ' Cancel'
},
confirm: {
label: ' Confirm'
}
},
callback: function (result) {
console.log('This was logged in the callback: ' + result);
}
});
Also applies to: Alert, Prompt, Custom
var locale = $('#locales').val();
bootbox.confirm({
message: "This confirm uses the selected locale. Were the labels what you expected?",
locale: locale,
callback: function (result) {
Example.show('This was logged in the callback: ' + result);
}
});
Please note: prompt requires the title
option (when using the options object). You may use the message
option,
but the prompt result will not include any form inputs from your message.
bootbox.prompt("This is the default prompt!", function(result){ console.log(result); });
If you want to style the input, you can target the .bootbox-input-text
class.
var locale = {
OK: 'I Suppose',
CONFIRM: 'Go Ahead',
CANCEL: 'Maybe Not'
};
bootbox.addLocale('custom', locale);
bootbox.prompt({
title: "This is a prompt with a custom locale! What do you think?",
locale: 'custom',
callback: function (result) {
Example.show('This was logged in the callback: ' + result);
}
});
bootbox.prompt({
title: "This is a prompt with a set of checkbox inputs!",
value: ['1', '3'],
inputType: 'checkbox',
inputOptions: [{
text: 'Choice One',
value: '1',
},
{
text: 'Choice Two',
value: '2',
},
{
text: 'Choice Three',
value: '3',
}],
callback: function (result) {
console.log(result);
}
});
Checkboxes are nested in an element with the class .bootbox-checkbox-list
.
If you want to style the individual checkbox inputs, you can target the .bootbox-input-checkbox
class.
message
value
bootbox.prompt({
title: "This is a prompt with a set of radio inputs!",
message: '
Please select an option below:
',
inputType: 'radio',
inputOptions: [
{
text: 'Choice One',
value: '1',
},
{
text: 'Choice Two',
value: '2',
},
{
text: 'Choice Three',
value: '3',
}
],
callback: function (result) {
console.log(result);
}
});
Radio buttons are nested in an element with the class .bootbox-radiobutton-list
.
If you want to style the individual radio inputs, you can target the .bootbox-input-radio
class.
When using the radio
option, the first radio button
will be checked if value
is missing or does not match an inputOptions
value.
Requires browser support: http://caniuse.com/#feat=input-datetime
bootbox.prompt({
title: "This is a prompt with a date input!",
inputType: 'date',
callback: function (result) {
console.log(result);
}
});
If you want to style the input, you can target the .bootbox-input-date
class.
Requires browser support: http://caniuse.com/#feat=email
bootbox.prompt({
title: "This is a prompt with an email input!",
inputType: 'email',
callback: function (result) {
console.log(result);
}
});
If you want to style the input, you can target the .bootbox-input-email
class.
Requires browser support: http://caniuse.com/#feat=input-number
bootbox.prompt({
title: "This is a prompt with a number input!",
inputType: 'number',
callback: function (result) {
console.log(result);
}
});
If you want to style the input, you can target the .bootbox-input-number
class.
bootbox.prompt({
title: "This is a prompt with a password input!",
inputType: 'password',
callback: function (result) {
console.log(result);
}
});
If you want to style the input, you can target the .bootbox-input-password
class.
bootbox.prompt({
title: "This is a prompt with select!",
inputType: 'select',
inputOptions: [
{
text: 'Choose one...',
value: '',
},
{
text: 'Choice One',
value: '1',
},
{
text: 'Choice Two',
value: '2',
},
{
text: 'Choice Three',
value: '3',
}
],
callback: function (result) {
console.log(result);
}
});
If you want to style the select, you can target the .bootbox-input-select
class.
bootbox.prompt({
title: "This is a prompt with a textarea!",
inputType: 'textarea',
callback: function (result) {
console.log(result);
}
});
If you want to style the textarea, you can target the .bootbox-input-textarea
class.
Requires browser support: http://caniuse.com/#feat=input-datetime
bootbox.prompt({
title: "This is a prompt with a time input!",
inputType: 'time',
callback: function (result) {
console.log(result);
}
});
If you want to style the input, you can target the .bootbox-input-time
class.
Requires browser support: http://caniuse.com/#feat=input-range
bootbox.prompt({
title: "This is a prompt with a range input!",
inputType: 'range',
min: 0,
max: 100,
step: 5,
value: 35,
callback: function (result) {
Example.show('This was logged in the callback: ' + result);
}
});
If you want to style the input, you can target the .bootbox-input-range
class.
Please note: Custom dialogs accept only one argument: an options object. The only required property of the options object is message
.
var dialog = bootbox.dialog({
message: '
 Please wait while we do something...
',
closeButton: false
});
// do something in the background
dialog.modal('hide');
Also applies to: Alert, Confirm, Prompt
var dialog = bootbox.dialog({
title: 'A custom dialog with init',
message: '
 Loading...
'
});
dialog.init(function(){
setTimeout(function(){
dialog.find('.bootbox-body').html('I was loaded after the dialog was shown!');
}, 3000);
});
var dialog = bootbox.dialog({
title: 'A custom dialog with buttons and callbacks',
message: "
This dialog has buttons. Each button has it's own callback function.
",
size: 'large',
buttons: {
cancel: {
label: "I'm a cancel button!",
className: 'btn-danger',
callback: function(){
Example.show('Custom cancel clicked');
}
},
noclose: {
label: "I don't close the modal!",
className: 'btn-warning',
callback: function(){
Example.show('Custom button clicked');
return false;
}
},
ok: {
label: "I'm an OK button!",
className: 'btn-info',
callback: function(){
Example.show('Custom OK clicked');
}
}
}
});


Home
About
Projects
Services
Contact
Welcome !!
I am Axit Patel
About Me
Don't write better error messages, write code that doesn't need them.
--Jason McDonald
Talk is Cheap. Show Me The Code.
--Linus Torvalds
Previous
Next
© axitpatel


{% extends "base.html" %} {% load scribbler_tags %} {% block title %}A Free and Open Source SMS Framework{% endblock title %} {% block body_id %}home{% endblock body_id %} {% block masthead %}
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore.
{% endscribble %}RapidSMS is a toolset for rapidly building SMS (text message) services for data collection, streamlining complex workflows, and group coordination using basic mobile phones — and can present information on the internet as soon as it is received.
{% endscribble %}{{ feature_project.description }}
Visit project page {% endif %}


In this notebook, some template code has already been provided for you, and you will need to implement additional functionality to successfully complete this project. You will not need to modify the included code beyond what is requested. Sections that begin with '(IMPLEMENTATION)' in the header indicate that the following block of code will require additional functionality which you must provide. Instructions will be provided for each section, and the specifics of the implementation are marked in the code block with a 'TODO' statement. Please be sure to read the instructions carefully!
Note: Once you have completed all of the code implementations, you need to finalize your work by exporting the iPython Notebook as an HTML document. Before exporting the notebook to html, all of the code cells need to have been run so that reviewers can see the final implementation and output. You can then export the notebook by using the menu above and navigating to \n", "File -> Download as -> HTML (.html). Include the finished document along with this notebook as your submission.
In addition to implementing code, there will be questions that you must answer which relate to the project and your implementation. Each section where you will answer a question is preceded by a 'Question X' header. Carefully read each question and provide thorough answers in the following text boxes that begin with 'Answer:'. Your project submission will be evaluated based on your answers to each of the questions and the implementation you provide.
Note: Code and Markdown cells can be executed using the Shift + Enter keyboard shortcut. Markdown cells can be edited by double-clicking the cell to enter edit mode.
The rubric contains optional "Stand Out Suggestions" for enhancing the project beyond the minimum requirements. If you decide to pursue the "Stand Out Suggestions", you should include the code in this IPython notebook.
In this notebook, you will make the first steps towards developing an algorithm that could be used as part of a mobile or web app. At the end of this project, your code will accept any user-supplied image as input. If a dog is detected in the image, it will provide an estimate of the dog's breed. If a human is detected, it will provide an estimate of the dog breed that is most resembling. The image below displays potential sample output of your finished project (... but we expect that each student's algorithm will behave differently!).
In this real-world setting, you will need to piece together a series of models to perform different tasks; for instance, the algorithm that detects humans in an image will be different from the CNN that infers dog breed. There are many points of possible failure, and no perfect algorithm exists. Your imperfect solution will nonetheless create a fun user experience!
We break the notebook into separate steps. Feel free to use the links below to navigate the notebook.
In the code cell below, we import a dataset of dog images. We populate a few variables through the use of the load_files
function from the scikit-learn library:
train_files
, valid_files
, test_files
- numpy arrays containing file paths to imagestrain_targets
, valid_targets
, test_targets
- numpy arrays containing onehot-encoded classification labels dog_names
- list of string-valued dog breed names for translating labelsfrom urllib.request import urlretrieve
from os.path import isfile, isdir
from tqdm import tqdm
dog_images_dir = 'dogImages/'
# Make sure dog directory exists
if not isdir(dog_images_dir):
!mkdir "$dog_images_dir"
class DLProgress(tqdm):
last_block = 0
def hook(self, block_num=1, block_size=1, total_size=None):
self.total = total_size
self.update((block_num - self.last_block) * block_size)
self.last_block = block_num
if not isfile(dog_images_dir+"dogImages.zip"):
with DLProgress(unit='B', unit_scale=True, miniters=1, desc='Dog Images') as pbar:
urlretrieve('https://s3-us-west-1.amazonaws.com/udacity-aind/dog-project/dogImages.zip',
dog_images_dir+'dogImages.zip',pbar.hook)
else:
print("Parameter file already exists!")
import zipfile
def extract_zip(zipFilePath):
zip_ref = zipfile.ZipFile(zipFilePath, 'r')
zip_ref.extractall()
zip_ref.close()
extract_zip(dog_images_dir + "dogImages.zip")
from sklearn.datasets import load_files
from keras.utils import np_utils
import numpy as np
from glob import glob
import pickle
# define function to load train, test, and validation datasets
def load_dataset(path):
data = load_files(path)
dog_files = np.array(data['filenames'])
dog_targets = np_utils.to_categorical(np.array(data['target']), 133)
return dog_files, dog_targets
# load train, test, and validation datasets
train_files, train_targets = load_dataset('dogImages/train')
valid_files, valid_targets = load_dataset('dogImages/valid')
test_files, test_targets = load_dataset('dogImages/test')
# load list of dog names
dog_names = [item[20:-1] for item in sorted(glob("dogImages/train/*/"))]
#save variables to file to avoid memory error:
pickle.dump(train_files, open("train_files.p" ,"wb"))
pickle.dump(train_targets, open("train_targets.p", "wb"))
pickle.dump(valid_files, open("valid_files.p", "wb"))
pickle.dump(valid_targets, open("valid_targets.p", "wb"))
pickle.dump(test_files, open("test_files.p", "wb"))
pickle.dump(test_targets, open("test_targets.p", "wb"))
pickle.dump(dog_names,open("dog_names.p","wb"))
# print statistics about the dataset
print('There are %d total dog categories.' % len(dog_names))
print('There are %s total dog images.\n' % len(np.hstack([train_files, valid_files, test_files])))
print('There are %d training dog images.' % len(train_files))
print('There are %d validation dog images.' % len(valid_files))
print('There are %d test dog images.'% len(test_files))
In the code cell below, we import a dataset of human images, where the file paths are stored in the numpy array human_files
.
humans_images_dir = 'lfw/'
!mkdir "$humans_images_dir"
from urllib.request import urlretrieve
from os.path import isfile, isdir
from tqdm import tqdm
humans_images_dir = 'lfw/'
# Make sure dog directory exists
if not isdir(humans_images_dir):
!mkdir "$humans_images_dir"
class DLProgress(tqdm):
last_block = 0
def hook(self, block_num=1, block_size=1, total_size=None):
self.total = total_size
self.update((block_num - self.last_block) * block_size)
self.last_block = block_num
if not isfile(humans_images_dir+"lfw.zip"):
with DLProgress(unit='B', unit_scale=True, miniters=1, desc='Human Images') as pbar:
urlretrieve('https://s3-us-west-1.amazonaws.com/udacity-aind/dog-project/lfw.zip',
humans_images_dir+'lfw.zip',pbar.hook)
else:
print("Parameter file already exists!")
extract_zip(humans_images_dir + "lfw.zip")
import random
random.seed(8675309)
# load filenames in shuffled human dataset
human_files = np.array(glob("lfw/*/*"))
random.shuffle(human_files)
pickle.dump(human_files ,open("human_files.p","wb"))
# print statistics about the dataset
print('There are %d total human images.' % len(human_files))
We use OpenCV's implementation of Haar feature-based cascade classifiers to detect human faces in images. OpenCV provides many pre-trained face detectors, stored as XML files on github. We have downloaded one of these detectors and stored it in the haarcascades
directory.
In the next code cell, we demonstrate how to use this detector to find human faces in a sample image.
import cv2
import matplotlib.pyplot as plt
%matplotlib inline
# extract pre-trained face detector
face_cascade = cv2.CascadeClassifier('haarcascades/haarcascade_frontalface_alt.xml')
# load color (BGR) image
img = cv2.imread(human_files[3])
# convert BGR image to grayscale
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
# find faces in image
faces = face_cascade.detectMultiScale(gray)
# print number of faces detected in the image
print('Number of faces detected:', len(faces))
# get bounding box for each detected face
for (x,y,w,h) in faces:
# add bounding box to color image
cv2.rectangle(img,(x,y),(x+w,y+h),(255,0,0),2)
# convert BGR image to RGB for plotting
cv_rgb = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
# display the image, along with bounding box
plt.imshow(cv_rgb)
plt.show()
Before using any of the face detectors, it is standard procedure to convert the images to grayscale. The detectMultiScale
function executes the classifier stored in face_cascade
and takes the grayscale image as a parameter.
In the above code, faces
is a numpy array of detected faces, where each row corresponds to a detected face. Each detected face is a 1D array with four entries that specifies the bounding box of the detected face. The first two entries in the array (extracted in the above code as x
and y
) specify the horizontal and vertical positions of the top left corner of the bounding box. The last two entries in the array (extracted here as w
and h
) specify the width and height of the box.
We can use this procedure to write a function that returns True
if a human face is detected in an image and False
otherwise. This function, aptly named face_detector
, takes a string-valued file path to an image as input and appears in the code block below.
# returns "True" if face is detected in image stored at img_path
def face_detector(img_path):
img = cv2.imread(img_path)
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
faces = face_cascade.detectMultiScale(gray)
return len(faces) > 0
Question 1: Use the code cell below to test the performance of the face_detector
function.
human_files
have a detected human face? dog_files
have a detected human face?  You will see that our algorithm falls short of this goal, but still gives acceptable performance. We extract the file paths for the first 100 images from each of the datasets and store them in the numpy arrays human_files_short
and dog_files_short
.
Answer:
human_files_short = human_files[:100]
dog_files_short = train_files[:100]
# Do NOT modify the code above this line.
## TODO: Test the performance of the face_detector algorithm
## on the images in human_files_short and dog_files_short.
number_of_human_faces =0
for i in range(len(human_files_short)):
if face_detector(human_files_short[i]):
number_of_human_faces +=1
else:
print("Unable to detect face in following image")
plt.imshow(cv2.imread(human_files_short[i]))
plt.show()
percent_humans_in_humanFiles = (number_of_human_faces/len(human_files_short))*100
print("Percentage of detected faces from human files: "+ str(percent_humans_in_humanFiles))
number_of_dog_faces =0
for i in range(len(dog_files_short)):
if face_detector(dog_files_short[i]):
number_of_dog_faces +=1
percent_humans_in_dogFiles = (number_of_dog_faces/len(dog_files_short))*100
print("Percentage of detected faces from dog files: "+ str(percent_humans_in_dogFiles))
Question 2: This algorithmic choice necessitates that we communicate to the user that we accept human images only when they provide a clear view of a face (otherwise, we risk having unneccessarily frustrated users!). In your opinion, is this a reasonable expectation to pose on the user? If not, can you think of a way to detect humans in images that does not necessitate an image with a clearly presented face?
Answer: No, accepting image only when clear view of the face is available is not a acceptable. To solve this problem we need to ensure that eyes and lips are always in same place in image, face landmark estimation algoritm can be used for this. Once we know where eyes & mouth are we can rotate, scale and shear the image so that eyes and mounth are centered as best as possible.
We suggest the face detector from OpenCV as a potential way to detect human images in your algorithm, but you are free to explore other approaches, especially approaches that make use of deep learning :). Please use the code cell below to design and test your own face detection algorithm. If you decide to pursue this optional task, report performance on each of the datasets.
## (Optional) TODO: Report the performance of another
## face detection algorithm on the LFW dataset
### Feel free to use as many code cells as needed.
In this section, we use a pre-trained ResNet-50 model to detect dogs in images. Our first line of code downloads the ResNet-50 model, along with weights that have been trained on ImageNet, a very large, very popular dataset used for image classification and other vision tasks. ImageNet contains over 10 million URLs, each linking to an image containing an object from one of 1000 categories. Given an image, this pre-trained ResNet-50 model returns a prediction (derived from the available categories in ImageNet) for the object that is contained in the image.
from keras.applications.resnet50 import ResNet50
# define ResNet50 model
ResNet50_model = ResNet50(weights='imagenet')
When using TensorFlow as backend, Keras CNNs require a 4D array (which we'll also refer to as a 4D tensor) as input, with shape
$$ (\text{nb_samples}, \text{rows}, \text{columns}, \text{channels}), $$
where nb_samples
corresponds to the total number of images (or samples), and rows
, columns
, and channels
correspond to the number of rows, columns, and channels for each image, respectively.
The path_to_tensor
function below takes a string-valued file path to a color image as input and returns a 4D tensor suitable for supplying to a Keras CNN. The function first loads the image and resizes it to a square image that is $224 \times 224$ pixels. Next, the image is converted to an array, which is then resized to a 4D tensor. In this case, since we are working with color images, each image has three channels. Likewise, since we are processing a single image (or sample), the returned tensor will always have shape
$$ (1, 224, 224, 3). $$
The paths_to_tensor
function takes a numpy array of string-valued image paths as input and returns a 4D tensor with shape
$$ (\text{nb_samples}, 224, 224, 3). $$
Here, nb_samples
is the number of samples, or number of images, in the supplied array of image paths. It is best to think of nb_samples
as the number of 3D tensors (where each 3D tensor corresponds to a different image) in your dataset!
from keras.preprocessing import image
from tqdm import tqdm
def path_to_tensor(img_path):
# loads RGB image as PIL.Image.Image type
img = image.load_img(img_path, target_size=(224, 224))
# convert PIL.Image.Image type to 3D tensor with shape (224, 224, 3)
x = image.img_to_array(img)
# convert 3D tensor to 4D tensor with shape (1, 224, 224, 3) and return 4D tensor
return np.expand_dims(x, axis=0)
def paths_to_tensor(img_paths):
list_of_tensors = [path_to_tensor(img_path) for img_path in tqdm(img_paths)]
return np.vstack(list_of_tensors)
Getting the 4D tensor ready for ResNet-50, and for any other pre-trained model in Keras, requires some additional processing. First, the RGB image is converted to BGR by reordering the channels. All pre-trained models have the additional normalization step that the mean pixel (expressed in RGB as $[103.939, 116.779, 123.68]$ and calculated from all pixels in all images in ImageNet) must be subtracted from every pixel in each image. This is implemented in the imported function preprocess_input
. If you're curious, you can check the code for preprocess_input
here.
Now that we have a way to format our image for supplying to ResNet-50, we are now ready to use the model to extract the predictions. This is accomplished with the predict
method, which returns an array whose $i$-th entry is the model's predicted probability that the image belongs to the $i$-th ImageNet category. This is implemented in the ResNet50_predict_labels
function below.
By taking the argmax of the predicted probability vector, we obtain an integer corresponding to the model's predicted object class, which we can identify with an object category through the use of this dictionary.
from keras.applications.resnet50 import preprocess_input, decode_predictions
def ResNet50_predict_labels(img_path):
# returns prediction vector for image located at img_path
img = preprocess_input(path_to_tensor(img_path))
return np.argmax(ResNet50_model.predict(img))
While looking at the dictionary, you will notice that the categories corresponding to dogs appear in an uninterrupted sequence and correspond to dictionary keys 151-268, inclusive, to include all categories from 'Chihuahua'
to 'Mexican hairless'
. Thus, in order to check to see if an image is predicted to contain a dog by the pre-trained ResNet-50 model, we need only check if the ResNet50_predict_labels
function above returns a value between 151 and 268 (inclusive).
We use these ideas to complete the dog_detector
function below, which returns True
if a dog is detected in an image (and False
if not).
### returns "True" if a dog is detected in the image stored at img_path
def dog_detector(img_path):
prediction = ResNet50_predict_labels(img_path)
return ((prediction <= 268) & (prediction >= 151))
Question 3: Use the code cell below to test the performance of your dog_detector
function.
human_files_short
have a detected dog? dog_files_short
have a detected dog?Answer:
### TODO: Test the performance of the dog_detector function
### on the images in human_files_short and dog_files_short.
human_files_short = human_files[:100]
dog_files_short = train_files[:100]
number_of_dog_faces =0
human_files_length = len(human_files_short)
dog_files_length = len(dog_files_short)
for i in range(human_files_length):
if dog_detector(human_files_short[i]):
number_of_dog_faces +=1
percent_dog_in_humanFiles = (number_of_dog_faces/human_files_length)*100
print("Percentage of images containing dog from human files: "+ str(percent_dog_in_humanFiles))
number_of_dog_faces =0
for i in range(dog_files_length):
if dog_detector(dog_files_short[i]):
number_of_dog_faces +=1
percent_dogs_in_dogFiles = (number_of_dog_faces/dog_files_length)*100
print("Percentage of images containing dog from dog files: "+ str(percent_dogs_in_dogFiles))
Now that we have functions for detecting humans and dogs in images, we need a way to predict breed from images. In this step, you will create a CNN that classifies dog breeds. You must create your CNN from scratch (so, you can't use transfer learning yet!), and you must attain a test accuracy of at least 1%. In Step 5 of this notebook, you will have the opportunity to use transfer learning to create a CNN that attains greatly improved accuracy.
Be careful with adding too many trainable layers! More parameters means longer training, which means you are more likely to need a GPU to accelerate the training process. Thankfully, Keras provides a handy estimate of the time that each epoch is likely to take; you can extrapolate this estimate to figure out how long it will take for your algorithm to train.
We mention that the task of assigning breed to dogs from images is considered exceptionally challenging. To see why, consider that even a human would have great difficulty in distinguishing between a Brittany and a Welsh Springer Spaniel.
| Brittany | Welsh Springer Spaniel |
|---|---|
It is not difficult to find other dog breed pairs with minimal inter-class variation (for instance, Curly-Coated Retrievers and American Water Spaniels).
| Curly-Coated Retriever | American Water Spaniel |
|---|---|
Likewise, recall that labradors come in yellow, chocolate, and black. Your vision-based algorithm will have to conquer this high intra-class variation to determine how to classify all of these different shades as the same breed.
| Yellow Labrador | Chocolate Labrador | Black Labrador |
|---|---|---|
We also mention that random chance presents an exceptionally low bar: setting aside the fact that the classes are slightly imabalanced, a random guess will provide a correct answer roughly 1 in 133 times, which corresponds to an accuracy of less than 1%.
Remember that the practice is far ahead of the theory in deep learning. Experiment with many different architectures, and trust your intuition. And, of course, have fun!
We rescale the images by dividing every pixel in every image by 255.
import h5py
def save_to_h5py_file(fileName, datasetName, data):
file = h5py.File(fileName, "w")
file.create_dataset(datasetName , data=data)
file.close()
from PIL import ImageFile
ImageFile.LOAD_TRUNCATED_IMAGES = True
# pre-process the data for Keras
train_tensors = paths_to_tensor(train_files).astype('float32')/255
save_to_h5py_file("train_tensors.hdf5","train_tensors",train_tensors)
valid_tensors = paths_to_tensor(valid_files).astype('float32')/255
save_to_h5py_file("valid_tensors.hdf5","valid_tensors",valid_tensors)
test_tensors = paths_to_tensor(test_files).astype('float32')/255
save_to_h5py_file("test_tensors.hdf5","test_tensors",test_tensors)
#soft reset to clear memory
%reset -f -s
Create a CNN to classify dog breed. At the end of your code cell block, summarize the layers of your model by executing the line:
model.summary()
We have imported some Python modules to get you started, but feel free to import as many modules as you need. If you end up getting stuck, here's a hint that specifies a model that trains relatively fast on CPU and attains >1% test accuracy in 5 epochs:
Question 4: Outline the steps you took to get to your final CNN architecture and your reasoning at each step. If you chose to use the hinted architecture above, describe why you think that CNN architecture should work well for the image classification task.
Answer:
import h5py
import numpy as np
def load_from_h5py_file(fileName, datasetName):
hf = h5py.File(fileName, 'r')
dataset = hf.get(datasetName)
dataset = np.array(dataset)
hf.close()
return dataset
#load data from file into memory
import pickle
train_tensors= load_from_h5py_file('train_tensors.hdf5','train_tensors')
train_targets = pickle.load(open("train_targets.p","rb"))
valid_tensors= load_from_h5py_file('valid_tensors.hdf5','valid_tensors')
valid_targets = pickle.load(open("valid_targets.p","rb"))
from keras.layers import Conv2D, MaxPooling2D, GlobalAveragePooling2D
from keras.layers import Dropout, Flatten, Dense
from keras.models import Sequential
model = Sequential()
#Increase depth using filters. Use same padding beacasue we do not want to lose
#information at the edge.
model.add(Conv2D(filters=16, kernel_size=3, padding ='same', activation = 'relu'
,data_format='channels_last', input_shape = (224,224,3)))
model.add(Conv2D(filters=32, kernel_size=3, padding='same', activation ='relu'))
#Use max pooling to reduce dimensions
model.add(MaxPooling2D(pool_size=2))
model.add(Conv2D(filters= 32 ,kernel_size =3, padding='same',activation='relu'))
model.add(MaxPooling2D(pool_size=2))
#Add dropout to avoid overfitting
model.add(Dropout(0.3))
model.add(Flatten())
model.add(Dense(500,activation='relu'))
model.add(Dropout(0.2))
#Use softmax activation to get the probabilities
#There are 133 dog brreds hence output shape of 133
model.add(Dense(133,activation='softmax'))
model.summary()
model.compile(optimizer='rmsprop', loss='categorical_crossentropy', metrics=['accuracy'])
Train your model in the code cell below. Use model checkpointing to save the model that attains the best validation loss.
You are welcome to augment the training data, but this is not a requirement.
from keras.callbacks import ModelCheckpoint
### TODO: specify the number of epochs that you would like to use to train the model.
epochs = 5
### Do NOT modify the code below this line.
checkpointer = ModelCheckpoint(filepath='saved_models/weights.best.from_scratch.hdf5',
verbose=1, save_best_only=True)
model.fit(train_tensors, train_targets,
validation_data=(valid_tensors, valid_targets),
epochs=epochs, batch_size=20, callbacks=[checkpointer], verbose=1)
model.load_weights('saved_models/weights.best.from_scratch.hdf5')
Try out your model on the test dataset of dog images. Ensure that your test accuracy is greater than 1%.
#Load data into memory
test_tensors= load_from_h5py_file('test_tensors.hdf5','test_tensors')
test_targets = pickle.load(open("test_targets.p","rb"))
# get index of predicted dog breed for each image in test set
dog_breed_predictions = [np.argmax(model.predict(np.expand_dims(tensor, axis=0))) for tensor in test_tensors]
# report test accuracy
test_accuracy = 100*np.sum(np.array(dog_breed_predictions)==np.argmax(test_targets, axis=1))/len(dog_breed_predictions)
print('Test accuracy: %.4f%%' % test_accuracy)
%cd bottleneck_features
!wget https://s3-us-west-1.amazonaws.com/udacity-aind/dog-project/DogVGG16Data.npz
%cd ..
%reset -f -s
import numpy as np
bottleneck_features = np.load('bottleneck_features/DogVGG16Data.npz')
train_VGG16 = bottleneck_features['train']
valid_VGG16 = bottleneck_features['valid']
test_VGG16 = bottleneck_features['test']
The model uses the the pre-trained VGG-16 model as a fixed feature extractor, where the last convolutional output of VGG-16 is fed as input to our model. We only add a global average pooling layer and a fully connected layer, where the latter contains one node for each dog category and is equipped with a softmax.
from keras.models import Sequential
from keras.layers import GlobalAveragePooling2D, Dense
VGG16_model = Sequential()
VGG16_model.add(GlobalAveragePooling2D(input_shape=train_VGG16.shape[1:]))
VGG16_model.add(Dense(133, activation='softmax'))
VGG16_model.summary()
VGG16_model.compile(loss='categorical_crossentropy', optimizer='rmsprop', metrics=['accuracy'])
import pickle
train_targets = pickle.load(open("train_targets.p","rb"))
valid_targets = pickle.load(open("valid_targets.p","rb"))
from keras.callbacks import ModelCheckpoint
checkpointer = ModelCheckpoint(filepath='saved_models/weights.best.VGG16.hdf5',
verbose=1, save_best_only=True)
VGG16_model.fit(train_VGG16, train_targets,
validation_data=(valid_VGG16, valid_targets),
epochs=20, batch_size=20, callbacks=[checkpointer], verbose=1)
VGG16_model.load_weights('saved_models/weights.best.VGG16.hdf5')
Now, we can use the CNN to test how well it identifies breed within our test dataset of dog images. We print the test accuracy below.
test_targets = pickle.load(open("test_targets.p","rb"))
# get index of predicted dog breed for each image in test set
VGG16_predictions = [np.argmax(VGG16_model.predict(np.expand_dims(feature, axis=0))) for feature in test_VGG16]
# report test accuracy
test_accuracy = 100*np.sum(np.array(VGG16_predictions)==np.argmax(test_targets, axis=1))/len(VGG16_predictions)
print('Test accuracy: %.4f%%' % test_accuracy)
from extract_bottleneck_features import *
def VGG16_predict_breed(img_path):
# extract bottleneck features
bottleneck_feature = extract_VGG16(path_to_tensor(img_path))
# obtain predicted vector
predicted_vector = VGG16_model.predict(bottleneck_feature)
# return dog breed that is predicted by the model
return dog_names[np.argmax(predicted_vector)]
You will now use transfer learning to create a CNN that can identify dog breed from images. Your CNN must attain at least 60% accuracy on the test set.
In Step 4, we used transfer learning to create a CNN using VGG-16 bottleneck features. In this section, you must use the bottleneck features from a different pre-trained model. To make things easier for you, we have pre-computed the features for all of the networks that are currently available in Keras:
The files are encoded as such:
Dog{network}Data.npz
where {network}
, in the above filename, can be one of VGG19
, Resnet50
, InceptionV3
, or Xception
. Pick one of the above architectures, download the corresponding bottleneck features, and store the downloaded file in the bottleneck_features/
folder in the repository.
In the code block below, extract the bottleneck features corresponding to the train, test, and validation sets by running the following:
bottleneck_features = np.load('bottleneck_features/Dog{network}Data.npz')
train_{network} = bottleneck_features['train']
valid_{network} = bottleneck_features['valid']
test_{network} = bottleneck_features['test']
%cd bottleneck_features
!wget https://s3-us-west-1.amazonaws.com/udacity-aind/dog-project/DogResnet50Data.npz
!ls
%cd ..
%reset -f -s
### TODO: Obtain bottleneck features from another pre-trained CNN.
import numpy as np
bottleneck_features = np.load("bottleneck_features/DogResnet50Data.npz")
train_resnet50 = bottleneck_features['train']
valid_resnet50 = bottleneck_features['valid']
test_resnet50 = bottleneck_features['test']
Create a CNN to classify dog breed. At the end of your code cell block, summarize the layers of your model by executing the line:
<your model's name>.summary()
Question 5: Outline the steps you took to get to your final CNN architecture and your reasoning at each step. Describe why you think the architecture is suitable for the current problem.
Answer: Here we are using transfer learning to leverage a ResNet50 network pre-trained on a large dataset. This network has already learned the feature that are useful for this problem, and leveraging such features would allow us to reach a better accuracy than any method that would only rely on the available data.
ResNet50 is already trained on ImageNet dataset. Imagenet dataset contains several dog classes so this model will already have learn features that are useful to dog breed classification problem.
Strategy used here is : Use the bottleneck feature provided by Udacity for ResNEt50 model. Then we train a small fully-connected model on top of the stored features.
from keras.models import Sequential
from keras.layers import Dense,GlobalAveragePooling2D, Dropout
resnet50_model = Sequential()
resnet50_model.add(GlobalAveragePooling2D(input_shape=train_resnet50.shape[1:]))
resnet50_model.add(Dense(256, activation='relu'))
resnet50_model.add(Dropout(0.3))
resnet50_model.add(Dense(133, activation='softmax'))
resnet50_model.summary()
### TODO: Compile the model.
resnet50_model.compile(loss='categorical_crossentropy', optimizer='rmsprop', metrics=['accuracy'])
Train your model in the code cell below. Use model checkpointing to save the model that attains the best validation loss.
You are welcome to augment the training data, but this is not a requirement.
import pickle
train_targets = pickle.load(open("train_targets.p","rb"))
valid_targets = pickle.load(open("valid_targets.p","rb"))
### TODO: Train the model.
from keras.callbacks import ModelCheckpoint
checkpointer = ModelCheckpoint(filepath='saved_models/weights.best.resnet50.hdf5',
verbose=1, save_best_only=True)
resnet50_model.fit(train_resnet50, train_targets,
validation_data=(valid_resnet50, valid_targets),
epochs=20, batch_size=20, callbacks=[checkpointer], verbose=1)
### TODO: Load the model weights with the best validation loss.
resnet50_model.load_weights('saved_models/weights.best.resnet50.hdf5')
Try out your model on the test dataset of dog images. Ensure that your test accuracy is greater than 60%.
test_targets = pickle.load(open("test_targets.p","rb"))
### TODO: Calculate classification accuracy on the test dataset.
# get index of predicted dog breed for each image in test set
resnet50_predictions = [np.argmax(resnet50_model.predict(np.expand_dims(feature, axis=0))) for feature in test_resnet50]
# report test accuracy
test_accuracy = 100*np.sum(np.array(resnet50_predictions)==np.argmax(test_targets, axis=1))/len(resnet50_predictions)
print('Test accuracy: %.4f%%' % test_accuracy)
Write a function that takes an image path as input and returns the dog breed (Affenpinscher
, Afghan_hound
, etc) that is predicted by your model.
Similar to the analogous function in Step 5, your function should have three steps:
dog_names
array defined in Step 0 of this notebook to return the corresponding breed.The functions to extract the bottleneck features can be found in extract_bottleneck_features.py
, and they have been imported in an earlier code cell. To obtain the bottleneck features corresponding to your chosen CNN architecture, you need to use the function
extract_{network}
where {network}
, in the above filename, should be one of VGG19
, Resnet50
, InceptionV3
, or Xception
.
### TODO: Write a function that takes a path to an image as input
### and returns the dog breed that is predicted by the model.
from extract_bottleneck_features import *
def Resnet50_predict_breed(img_path):
# extract bottleneck features
bottleneck_feature = extract_Resnet50(path_to_tensor(img_path))
# obtain predicted vector
predicted_vector = resnet50_model.predict(bottleneck_feature)
# return dog breed that is predicted by the model
return dog_names[np.argmax(predicted_vector)]
Write an algorithm that accepts a file path to an image and first determines whether the image contains a human, dog, or neither. Then,
You are welcome to write your own functions for detecting humans and dogs in images, but feel free to use the face_detector
and dog_detector
functions developed above. You are required to use your CNN from Step 5 to predict dog breed.
Some sample output for our algorithm is provided below, but feel free to design your own user experience!
dog_names = pickle.load(open("dog_names.p","rb"))
# We can reuse the function defined earlier but to save memeory reset is used at specific interval in notebook
# Due to reset, earlier reference to this function will be lost.
# Hence rather than scrolling and running the function again i have added the function here.
import cv2
def face_detector(img_path):
img = cv2.imread(img_path)
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
face_cascade = cv2.CascadeClassifier('haarcascades/haarcascade_frontalface_alt.xml')
faces = face_cascade.detectMultiScale(gray)
return len(faces) > 0
from keras.applications.resnet50 import ResNet50
# define ResNet50 model
ResNet50_model = ResNet50(weights='imagenet')
from keras.preprocessing import image
from tqdm import tqdm
import numpy as np
def path_to_tensor(img_path):
# loads RGB image as PIL.Image.Image type
img = image.load_img(img_path, target_size=(224, 224))
# convert PIL.Image.Image type to 3D tensor with shape (224, 224, 3)
x = image.img_to_array(img)
# convert 3D tensor to 4D tensor with shape (1, 224, 224, 3) and return 4D tensor
return np.expand_dims(x, axis=0)
def paths_to_tensor(img_paths):
list_of_tensors = [path_to_tensor(img_path) for img_path in tqdm(img_paths)]
return np.vstack(list_of_tensors)
from keras.applications.resnet50 import preprocess_input, decode_predictions
def ResNet50_predict_labels(img_path):
# returns prediction vector for image located at img_path
img = preprocess_input(path_to_tensor(img_path))
return np.argmax(ResNet50_model.predict(img))
### returns "True" if a dog is detected in the image stored at img_path
def dog_detector(img_path):
prediction = ResNet50_predict_labels(img_path)
return ((prediction <= 268) & (prediction >= 151))
def predict_breed(img_path):
isDog = False
isHuman = False
if dog_detector(img_path):
isDog =True
return isDog, isHuman, Resnet50_predict_breed(img_path)
elif face_detector(img_path):
isHuman = True
return isDog, isHuman, Resnet50_predict_breed(img_path)
else:
return isDog, isHuman, "Uploaded image does not have humans or dogs."
In this section, you will take your new algorithm for a spin! What kind of dog does the algorithm think that you look like? If you have a dog, does it predict your dog's breed accurately? If you have a cat, does it mistakenly think that your cat is a dog?
Test your algorithm at least six images on your computer. Feel free to use any images you like. Use at least two human and two dog images.
Question 6: Is the output better than you expected :) ? Or worse :( ? Provide at least three possible points of improvement for your algorithm.
Answer: Yes the output is definitely better than expected. First and last result does not look correct. In last photo acutal dog breed is Rhodesian Ridgeback but it is detected as bloodhound. In third set based on fur cloaths dog having fur is predicted. In Fourth set based on the way hairs are placed beagle dog breed is predicted. To further improve algorithm following can be done:
#Dowmload some test images to test our algorithm
!mkdir myImages
%cd myImages
!wget https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSr-f_bpkz4Og4Unbpck5QpzgVYwdvL8X-CqZlwAbKzMLIz9yuA
!wget https://www.rd.com/wp-content/uploads/2016/01/04-dog-breeds-dalmation.jpg
!wget https://cmeimg-a.akamaihd.net/640/cme/cuteness_data/s3fs-public/diy_blog/Top-10-Dog-Breeds-Suitable-for-Young-Kids.jpg
!wget https://storage.googleapis.com/tcg-content/crimewire/2013/02/Rhodesian-Ridgeback2.jpg
!wget http://digitalspyuk.cdnds.net/17/33/980x490/landscape-1502909283-got3.jpg
!wget http://images.amcnetworks.com/amc.com/wp-content/uploads/2016/11/23214_HUMANS_S2_Mia_Is_A_Synthetic_10.jpg
%cd ..
from glob import glob
#Get first image for each dog breed type
dog_breed_images = [glob(item+"/*")[0] for item in sorted(glob("dogImages/train/*/"))]
import glob
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
fileNames =glob.glob("myImages/*")
for filepath in fileNames:
isDog, isHuman, breed = predict_breed(filepath)
if(isDog):
#display(Image(filename=dog_breed_images[dog_names.index(breed)],width=400, height=400))
predicatedImage =mpimg.imread(dog_breed_images[dog_names.index(breed)])
actualImage = mpimg.imread(filepath)
fig = plt.figure()
ax1 = fig.add_subplot(1,2,1)
ax1.set_title("Predicated Breed : " + breed)
ax1.imshow(predicatedImage)
ax2 = fig.add_subplot(1,2,2)
ax2.set_title("Actual Image")
ax2.imshow(actualImage)
plt.show()
elif(isHuman):
predicatedImage =mpimg.imread(dog_breed_images[dog_names.index(breed)])
actualImage = mpimg.imread(filepath)
fig = plt.figure()
ax1 = fig.add_subplot(1,2,1)
ax1.set_title("Human you look like Breed : " + breed)
ax1.imshow(predicatedImage)
ax2 = fig.add_subplot(1,2,2)
ax2.set_title("Actual Image")
ax2.imshow(actualImage)
plt.show()
else:
print(breed)
actualImage = mpimg.imread(filepath)
fig = plt.figure()
ax1 = fig.add_subplot(1,1,1)
ax1.set_title("Actual Image")
ax1.imshow(actualImage)
plt.show()


Howdy, Partner! You probably stumbled on this page because you saw one of our ads and you tracked the link back here to check it out. This URL is used by AdRight for ad serving.
If you are an Advertiser and would like to run profitable campaigns please click HERE
If you are a Publisher and would like to earn more money for your traffic please click HERE


| Class | ActiveResource::Base |
| In: |
lib/ActiveResource/base.rb
|
| Parent: | Object |
Provides an ActiveRecord-like class count method, used in conjunction with ApplicationController::count Example: Foo.count -> 2
Generate a blank resource with the fields filled in to nil or default values (See Also ApplicationController::new) ?
Returns a URI object to the resource collection, useful in forms, for example form_for :foo, @foo, Foo.plural_url.to_s, :method => :post POSTS to host.com/foos
In some case this can be useful as ActiveResource generated URLs from other methods witll append .xml
Returns a URI object to a sinle resource, useful in forms, for example form_for :foo, @foo, Foo.singular_url(@foo.id).to_s, :method => :post POSTS to host.com/foos TODO: take object and use to_param
When using an association with ActiveResource, a nil association raises an error Example: @foo.bar -> NoSuchMethodError: <foo blah blah>bar with this alias you get a blank object instead @foo.bar -> # a blank bar object
Instance Methods return the single URI object to this instance convenience method, just wraps to class form_for :foo, @foo, @foo.singular_url.to_s, :method => :post POSTS to host.com/foos TODO: take object and use to_param


{{ if captchaEnabled }} {{ end }} {{ template "head" . }}
Home
Library
House list
Server information
Support list
Spell list
Community
Who is online
Highscores
Search character
Guild list
Guild wars
Latest deaths
{{ serverName }}
{{ serverMotd }}
{{ template "beforeContent" . }}


|
My Project
|
Go to the source code of this file.
Macros | |
| #define | RENDERMETHODS_H |
Functions | |
| void | render2DHidden (Fig3D &object3D, QPainter &painter, int plane, double scale_factor) |
| Renders the figure and also marks lines as hidden where they are hidden by some plane. More... | |
| bool | opposite_side (vector< Vertice > &faceVertices, Vertice a, Vertice b) |
| Vertice | back_proj (Vertice v, Edge e, int plane) |
| #define RENDERMETHODS_H |
Methods for rendering 3D object and diplaying 2D views (will use OpenGL and GTK libraries)
returns vertex on 3D edge e whose projection is v
returns 3D vertex on Edge e whose projection is v
returns true if a and b are on opposite side of plane formed by faceVertices , false otherwise
| void render2DHidden | ( | Fig3D & | object3D, |
| QPainter & | painter, | ||
| int | plane, | ||
| double | scale_factor | ||
| ) |
Renders the figure and also marks lines as hidden where they are hidden by some plane.


G1 and G2 fitting with clothoids, spline of clothods, circle arc and biarc¶
Github repository https://github.com/ebertolazzi/Clothoids
Matlab TOOLBOX https://github.com/ebertolazzi/Clothoids/releases
Installation¶
Matlab¶
Download the toolbox and install as usual.
Run CompileClothoidsLib
on Matlab console windows
to compile the mex
of the library.
C++¶
Download the library
git clone git@github.com:ebertolazzi/Clothoids.git —recurse-submodules
if you forget —recurse-submodules
you must load the submdule
quarticRootsFlocke next. To compile the library you can use make
make
or cmake
mkdir build
cd build
cmake ..
make
of rake
rake build_osx # on mac
rake build_linux # on linux
rake build_win # on windows
using make
you have the library and headers in the following tree
`-- lib
|-- include
| |-- AABBtree.hh
| |-- Biarc.hh
| |-- BiarcList.hh
| |-- Circle.hh
| |-- Clothoid.hh
| |-- ClothoidAsyPlot.hh
| |-- ClothoidList.hh
| |-- Fresnel.hh
| |-- G2lib.hh
| |-- Line.hh
| |-- PolyLine.hh
| |-- PolynomialRoots-Utils.hh
| |-- PolynomialRoots.hh
| `-- Triangle2D.hh
`-- lib
|-- libClothoids_OSTYPE.dylib
`-- libClothoids_OSTYPE_static.a
where OSTYPE can be linux
, osx
, mingw_x64
, win_x64
Contents¶
-
Matlab Interface Manual
- Installation mex/MATLAB interface
- LineSegment
- Constuctors
- Methods
- Evaluation Methods
- CircleArc
- Constuctors
- Methods
- Distance Methods
- Evaluation Methods
- Biarc
- Constuctors
- Methods
- Distance Methods
- Evaluation Methods
- ClothoidCurve
- Constuctors
- Methods
- Distance and intersection Methods
- Evaluation Methods
- ClothoidList
- ClothoidSplineG2
- Triangle2D
- FresnelCS
- C++ API
- MATLAB API
References¶
-
E. Bertolazzi, M. Frego, G1 fitting with clothoids,Mathematical Methods in the Applied Sciences,John Wiley & Sons, 2014, vol. 38, n.5, pp. 881-897,
-
E. Bertolazzi, M. Frego, On the G2 Hermite interpolation problem with clothoids,Journal of Computational and Applied Mathematics,2018, vol. 15, n.341, pp. 99-116.
-
E. Bertolazzi, M. Frego, Interpolating clothoid splines with curvature continuity,Mathematical Methods in the Applied Sciences,2018, vol. 41, n.4, pp. 1099-1476.
-
E. Bertolazzi, M. Frego Point-Clothoid Distance and Projection Computation,SIAM Journal on Scientific Computing,2019, 41(5), A3326–A3353.
-
E. Bertolazzi, M. Frego A Note on Robust Biarc Computation,Computer-Aided Design & Applications 16 (5), 822-835
License¶
Copyright (c) 2020, Enrico Bertolazzi and Marco Frego
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the distribution
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED.


Psalms 89:8
O LORD God of hosts, who is a strong LORD like unto thee? or to thy faithfulness round about thee?


The chart shows the percentage of each sentiment extracted from the comments. Each bar represents one video or group of videos.
Sentiment scores are calculated with three sentiment analysis tools (AFINN, NLTK, and TextBlob). Each tool returns a polarity value when the input text is evaluated as showing positive or negative sentiment. They return neutral when the text contains no sentiment bearing word or when negative and positive words are perfectly balanced. "Mixed sentiment" means that one comment was detected as both positive and negative by different tools. Non-English comments are not assessed by the tools and are shown as N/A (not available).
Not enough data to render chart.
Show N/A
Only comments written in English are assessed for sentiment.


Not Found
Not Found
This page doesnt exist!
Template by CloudCannon
Template by DSP Dread Server Productions


© 2018 All Rights Reserved
Education Needs Complete Solution
© 2018 Institute . All Rights Reserved | Design by W3layouts


screenX:
screenY:
|
pageX:
pageY:
|
clientX:
clientY:
List King
Buy groceries
fresh
figs
pine nuts
honey
balsamic vinegar
linguine
cream
quinoa
sourdough bread
kale
almond milk
mushrooms
apples
strawberries
rice crackers
brie
rice


{% extends 'layout.html' %} {% block pageTitle %} Submitted {% endblock %} {% block beforeContent %} {% endblock %} {% block content %}
Mother's certificate number: 1 000 000 003
Exemption ends: 09 January 2022
We'll email these details to the mother. She can start using her exemption straight away
If the mother is happy to take part in further research, send us a contact number (opens a new window)


Bird Moon
I can’t find
my body
in the rubble
of memory
Most nights
I smoke bongs alone
wanting
for the full moon
thinking about
my childhood
I thought I loved
a werewolf-like man
Equally grotesque
and fuckable
born in 1982
Sometimes
I think I hear
the birds that lived
in the chimney
of his room
Their
wet white shit
always
on the bed
I am most happy
when the air
is thick with jasmine
I am a nicer adult
than I was little girl


March 1989
Tim laid out hid´s vision for what would...
Tim laid out hid´s vision for what would...
Tim laid out hid´s vision for what would...
Tim laid out hid´s vision for what would...
Tim laid out hid´s vision for what would...
Tim laid out hid´s vision for what would...
Tim laid out hid´s vision for what would...
Tim laid out hid´s vision for what would...


This is a short example of how to use the functionality in CommonHIT. Please inspect this document's source code to see how certain functionality is being achieved.
Here is how to include the YouTube player:
Attributes:
id
class="lll-player"
lllight.js
to insert a YouTube player here.data-video-id
data-log-field
lllight.js
will create
for storing the user's interactions with the video player.
data-name
lllight.js
will use
to expose the scripting functionality of the video player.
For example, you can use JavaScript to .stop()
the playback of a video.
data-width, data-height
commonhit.js
will automatically generate
the required name
and id
attributes and link
the label
-tags to the choices.
textarea
to have workers explain their answers.
Within a div
with class="hit-question"
,
a name
attribute will be generated automatically based on the provided
data-name
-attribute.
class="hit-browser-ua"
class="hit-html5-video-support"
class="hit-screen-resolution"


"Your payment Is Succsesful You Will Be Redirct To The Home Page "
You Will Be Not Redirected To Home Page Please Click The Link Below


Each plugin is implemented as a script placed in the plugins folder and having the extension .plugin.js.
Individial plugins are registered with the system and placed in the editor context menu by adding them to plugins/plugins.json, each line having the following syntax:
"Contextmenu path": "filename_without_extension"
The context menu path is similar to a normal UNIX path (using forward slashes), with each path element corresponding to a subgroup in the menu and the leaf node being the name of the plugin itself.
Each plugins can be roughly categorized into one of three groups:
Generators: Plugins that only have output slots. Represents sources of data, which can be anything from user input to execution context values.
Modulators: Plugins with both in- and outputs. Can be considered filters and represent operations on data from one or more sources.
Emitters: Plugins with only input slots. Usually provide final presentation of data wich can be rendering, playback or recording.
A few plugins have neither in- or outputs and these usually serve cosmetic purposes. One example is the Annotation plugin, which provides a persistent on-canvas note or comment.
The beginning of each plugin implemenatation starts with the declaration of a constructor function and its assignment to a property in the plugins registry contained in the E2 namespace. To avoid leaving a dangling temporary variable around after load of the last registered plugin, this is typically simultaneously assigned to the E2.p variable to aid in subsequent prototypical declaration of plugin methods.
Example:
E2.p = E2.plugins[“filename_without_extension”] = function(core, node) { this.desc = ‘Text string describing the plugin and its operation.’;this.input_slots = [ { name: 'in', dt: core.datatypes.FLOAT, desc: 'Positive or negative input value', def: 0 } ]; this.output_slots = [ { name: 'out', dt: core.datatypes.BOOL, desc: 'True if <b>in</b> > 0', def: true } ]; this.state = {} // Optional. Declaration can be ommitted. };
The name of the property of E2.plugins the constructor is assigned to must match the filename of the plugin implementation sans extension, and also the identifier used to register it in plugins/plugins.json.
In- and output slot arrays can be empty, but must be present. Slots declared at plugin creation time are termed static, as opposed to slots created arbitrily after plugin instantiation, which are called dynamic.
The state member object is automatically persisted and deserialized by the Core. If a plugin does not require persistent state, the plugin.state member can be left undefined.
The plugin model is event driven. Event handlers are simply methods using reserved names that - if declared by a given plugin - are automatically called by the Core at appropriate times. Plugins implementators can choose to implement any subset of these that are relevant for the behaviour of a given plugin. In the following section, all reserved methods will be described:
Called on plugin load, instantiation and when playback is stopped.
Is scheduled for deprecation in favour of stop()
, and should not be used unless strictly necessary.
If declared, this method will be called by the core immediately before its parent Node is destroyed along with all associated resources.
Called immediately before graph playback begins.
Called immediately after graph playback is paused.
Called immediately after graph playback is stopped.
Called when the state of a given in- or outbound connection to or from this plugin changes.
update_input()
below for more details).This method is typically implemented when a plugin need to respond to disconnection of inbound sources of data.
Called whenever an input slot has new data to deliver.
The slot parameter is an object containing the following members:
To check what static slot is currently receiving input slot.index is used. The data can either be stored in plugin trainsient state by storing it in an arbitrary class property, be stored in the persisted plugin.state object, change UI state in response on incoming data and so on.
If the plugin declares dynamic slots, whether slot.uid is defined can be used to differenciate
between input to dynamic vs. static slots. Remember that slot.uid can legally be zero, so use
(slot.uid !== undefined)
to check for this.
Called one every frame after all calls to update_input()
has completed, if:
Called once for every connected output slot if update_state()
was previously called this frame.
Like update_input()
, the slot parameter is a slot declaration and contains exactly the same members.
Called when the canvas on which the plugin resides is being switched to for editing.
jQuery is guaranteed to be available globally, so $ can be used, although the used of jQuery, especially for event handling is discouraged in production code for performance reasons.
Plugin implementators can create any nested set of DOM objects here, set up their own event
handling and anything else they might like. When done, create_ui()
is expected to return the
root DOM element created, which will be dynamically shown on the surface of the plugin instance
whenever visible in the editor.
This method is called once after plugin creation or deserialization with ui set to null. This call
can be used to do fundamental plugin instance initialization. If the plugin declares a UI, this method
will be called seperately with ui
equal to the root DOM element returned by create_ui()
earlier.
update_state()
need to be called as a consequence.Returns the string currently being used for the visible header of the node.
Adds a new dynamic slot to the current node.
Removes a dynamic slot from this node.
Returns the slot definition for a given dynamic slot.
Renames the specified slot.
Changes the data type of the specified slot. Unless the new data type is ANY, existing connection to or from the specified slot are destroyed.
Returns the default value for the supplied data type.
update_output()
:
Since output slots can be connected to more than once receiver concurrently, update_output()
will be
called once for each outbound connection that’s attached when the Core detects a successful run of
update_state()
. Thus calculations should always be performed in update_state()
which will at most
be run once per frame, and cached later to be returned on request from update_output()
.WebGL rendering:
The current WebGL graphics context of the active rendering canvas can be obtained via the core
parameter
supplied to the plugin constructor function as: core.renderer.context
Computing and caching output values in update_input()
:
As an exception to the above rule, it is possible is very simple cases to perform a calculation directly
in update_input()
and cache it for later emission by update_output()
, omitting implementation of
update_state()
which will yield slightly better performance. This can only be done where the calculation
depend on the value of a single input only, since the update order of input slots are not guranteed. In
cases where the result of a plugin depends on the value of more than one input, the input values must be
cached and the calculation be performed in update_state()
.
For example, we can imagine a plugin which adds 1 to an input float value implement its update_input()
and update_output()
as follows:
E2.p.prototype.update_input = function(slot, data)
{
// We have only one input, no need to mask on slot.index -- it will always be 0
// 'data' is guaranteed to be a float.
this.output_value = data + 1;
};
// No need for update_state() here...
E2.p.prototype.update_output = function(slot, data)
{
return this.output_value;
}
update_state()
:
Whenever update_state()
is called, it’s implied that the plugin updated
property is true. It
is possible for a plugin implementation to abort data output based on logic in update_state()
by setting
updated
to false, in which case no calls to update_output()
will occur.


|
OGL_SceneLoader
OpenGL scene loader
|
Classes | |
| class | Camera |
| class | Color_Buffer |
| class | Color_Buffer_Rgba8888 |
| class | Cube |
| class | Elevation_Mesh |
| Represents a terrain mesh created from an elevation texture. More... | |
| class | Fragment_Shader |
| class | Framebuffer |
| Used to render the scene to a framebuffer and apply post processig shaders to it. More... | |
| class | Input |
| Controls user input. More... | |
| class | Mesh |
| Represents the mesh data of the models. More... | |
| class | Model |
| Represents a 3D model with several meshes. More... | |
| class | myScene |
| Custom Scene for this specific example. More... | |
| class | Node |
| Represents an object in the scene graph. More... | |
| class | Scene |
| Default scene setup. More... | |
| class | Shader |
| class | Shader_Program |
| class | Skybox |
| Represents the cubemap texture rendered as the scene background. More... | |
| class | Texture_Cube |
| class | Variant |
| class | Vertex_Shader |
| class | View |
| DEPRECATED. More... | |
Typedefs | |
| typedef Color_Buffer_Rgba8888 | Texture |
| typedef Color_Buffer_Rgba8888 | Buffer |
| typedef Color_Buffer_Rgba8888 oglsl::Buffer |
| typedef Color_Buffer_Rgba8888 oglsl::Texture |


Schematic
In this circuit, the same voltage divider circuit as Assignment 3 is used here to measure the voltage drop across the LDR using pin A0. PIN 10 is used as the voltage source for the base of the transistor with a resistor connected in series to prevent an over-supply of current. The LED strip connected to a 12V power supply is connected to an ammeter in series and then to the collector of the transistor. The emmitor is connected to ground.
Current Through LED Strip
To ensure that the current through the collector-emitter does not exceed 0.6A. An ammeter is connected in series with the LED strip to measure the current at all times. When the transistor's gate is on, the current through is only at 0.07A (70mA).
Resistance Calculations
The calculations for R1 is the same as that of Assignment 3 since the same circuit is used. For RB, it is derived from the fact that I/O pins have a max current of 40mA. Since the activation voltage for the transistor is around 0.5V - 0.6V, RB should be greater than 110Ω. According to Nadya, a good rule of thumb for resistors connected to transistor bases are 10kΩ and above.
Arduino .ino File
The range of input values coming from the photoresistor pin is initially determined using the serial monitor. After knowing the range for the given environment, I set up the if statements for the LED strips (around 400 this time).


-
Step 1
Shopping Cart
-
Step 2
Payment Methods
-
Step 3
Delivery Methods
-
Step 4
Confirmation
| Items | Price | Quantity | Total Price | |
|---|---|---|---|---|
|
CSS Puns Ninja |
$25.95 |
|
$51.90 | |
|
Matias Ergo Pro Keyboard |
$299.95 |
|
$299.95 | |
|
Promotion Code |
Grand total: $351.85 |
Realy?
Seems like you have too much time to waste!
What about finding some real-life friends and doing something useful with your life?


Hello, I'm Jordan Walker.
Front-End Developer / Designer
A web application built to render detailed information about a vehicle from its Vehicle Identification Number (VIN).
A dashboard built using d3.js and census data on population growth.
Since 2010, I have been creating digital works of art.
I have worked with almost every platform creating webpages, mobile apps and video games.
I have authored software with C++, C#, Java, Javascript, HTML5, CSS3, Python and Assembly and design using Adobe Photoshop, Illustrator, Figma.


AUG-specific tutorial¶
How to access the ToFu library¶
The plugin for ASDEX Upgrade (AUG) is hosted on the theory (Tok) clusters of the Max-Planck Institute for Plasma Physics (IPP) in Garching. If you have an account in IPP, you can then connect to one of the tok clusters where the library is hosted, via the command:
>>> ssh toki01
Enter your password and then you need to load the module in the terminal
>>> module load tofu
You may need to load other modules on which ToFu depends (see the dependencies).
You can then start a ipython console and load the AUG plugin for ToFu:
>>> import tofu.plugins.AUG as tfAUG
How to load existing geometry¶
You can now load the geometry that was already computed and stored for some diagnostics (only the Soft X-Ray diagnostic at this date).
In general loading the geometry means using a method of the plugin that will load and return a list of tofu.geom.GDetect
instances.
On AUG, each tofu.geom.GDetect
instance corresponds to a camera head.
Since the geometry (position, aperture size…) of each camera head may change in time (changes are sometimes implemented between experimental campaigns), you can specify a shot number and the plugin will return the latest geometry that was computed before that shot number (only a few have been computed so far, but more will come).
>>> LGD = tfAUG.SXR.geom.load(shot=31801)
This command returns a list of tofu.geom.GDetect
instances with the latest geometry computed before shot 31801.
How to load SXR data¶
the ToFu plugin for AUG also comes with a data loading and formatting routine. In addition to a shot number and a time window, you can choose whether the data is returned as numpy arrays or as a ToFu-compatible object for data pre-treatment via the Tofu keyword argument.
>>> pre = tfAUG.SXR.data.load(shot=30801, Dt=[2.,2.01], Method='SX', Tofu=True)
This command will return the SXR data for shot 30801 in the [2.,2.01] s time window using diagnostic ‘SX.’ (instead of SSX), in the form of a ToFu-compatible object. See the documentation of the method for more details.


Deep-Learning-Training-GUI
Home
(current)
Training
Predict
Your Projects [Coming Soon]
Set Your Model
Choose what you want to do firstly, then set few parameters to train your model.
Image Classification
Object Detection [In Development]
Name of your project *
set your dataset path (datasets/example_dataset) *(required)
Type of label *(required)
json
Pre-trained Models *(required)
Mask RCNN
Number of Classes *(required)
Split the dataset (0.20 is fine) *(required)
Batch Size (default: 16)
Epoch (Iteration) (default: 10)
Name of your project *
set your dataset path (datasets/example_dataset)
Split the dataset (0.20 is fine)
Are you sure for this split_dataset value? Lower than 0.20 could be a problem.
Your split_dataset value is bigger than 0.50! This could be a problem.
Your split_dataset value is great!
Data Augmentation
Flipping
Rotation
Zoom
Samples - Default Value: 100 ( If you write 200, The system will generate 200 augmented images based on your specifications. )
Fine-Tuning
Activate
Fine Tune Epochs (Default: 10)
Your Fine Tuning value is lower than 4, your training acc may not increase.
Your Fine Tuning value is fine!
Your Fine Tuning value is greater than 30, you may have over-fitting problem.
Pre-trained Models *
MobileNetV2
InceptionV3
VGG16
VGG19
NASNetMobile
SimpleCnnModel
CPU/GPU
/GPU:0
/CPU:0
Number of Classes
You must choose an activation function for training (ReLu is better than sigmoid, change my mind).
sigmoid
relu
Actually You have 2 class. Your dataset should be like that for example: cat and non-cat. Sometimes that means you have one class but you don't. So you need to change your number of classes to 2.
Batch Size
Epoch (Iteration)
Your epoch is lower than 7. Your model may not be trained well. If you have over-fitting, you can choose lower than 7.


Email
Linked In
Colin Thompson | LinkedInTechnical Director, Pixar Animation Studios.
Technical Director, Pixar Animation Studios.
Twitter


A entry level full stack software development major student with customer service and school project.
2015 to present
Course work:
Rui Tai Auto Part- China
2019
SAP develop assistant-Intern


Gear Check
What's in your bag?
Pack smart and use the bag-check service on race day.
Like many distance races, the Blue Cross Broad Street Run offers a gear check service for runners. This convenient service shuttles your gym or duffle bag from the starting area to the finish line.
Not only does this mean that you can wear sweats before the start of the race, but you can also bring along some dry clothes, socks, and shoes for post-race.
Things you might want to pack:
• change of socks, shoes, or sandals
• change of clothes
• a hat
• favorite sports recovery bar
• sunglasses/sunscreen
• wet wipes
• tissues
• extra safety pins for attaching the race bib
• band aids
Things not to pack in your gym bag:*
• money
• cell phone
• keys
* We realize that many runners need these items for race day. In those cases, we suggest wearing an elastic waist pouch (it's like a fanny-pack that doesn't bounce around) on race day. Also, while tying keys to shoelaces is a common practice of runners, please realize the risk you run of loosing your keys.
How to use the gear check
Look for the yellow school busses above the start line area.
Bring your own gym or duffel bag for your gear.
Mark your bag with the tag supplied on race day. Any bag that is not properly marked will not be accepted.
Place your bag on the bus that displays the number that corresponds to your race bib. This system is designed to help you locate your bag at the finish area.
At the finish, display your official race number to the volunteers and your items will be returned. Please be patient and courteous, as this is a big job for our volunteers to handle.


CrimPapers
Articles published on 21 February 2020
On 21 February 2020, 7 new articles were published in 7 journals.
Dead Reckoning: Unraveling How “Homicide” Cases Travel From Crime Scene to Court Using Qualitative Research Methods by Fiona Brookman, Helen Jones, Robin Williams, Jim Fraser
The Criminal Justice System Response to Intimate Partner Stalking: A Systematic Review of Quantitative and Qualitative Research
Risk Assessment Analysis of Attacks on Farc Ex-Combatants: Towards A New Evaluation Model of Probability by Jerónimo Ríos, Julio César González, William Pachón
Zealot: A Book About Cults by Ian Freckelton
Book Review: Race, Gender, Class, and Criminal Justice: Examining Barriers to Justice by Cheryl Laura Johnson
Interagency Collaboration and the Management of Counter-Insurgency Campaigns Against Boko Haram in Nigeria
The Oxymoron of A Benevolent Authoritarian Leadership: the Case of Lebanon’s Hezbollah and Hassan Nasrallah by Anastasia Filippidou


{% extends "base.html" %} {% block body %}
{{ note.note }}
Updated: {{ note.timestamp|date }} {{ note.timestamp|time }}
Back to list | Edit note | Delete note