Go to directory pageImportant Cs Concepts :
General Cs :
- Finite State Machine: A model for showing the states and actions of a system.
See: Automata_theory, FSM example, and Finite-state_machine.
- Neural Networks: A synthetic network of nodes that can be changed to learn to do specific complex but simple tasks (paradox? yes).
See: neural network tutorial w/ handwritten digits & deep belief nets video. - Control Theory: Think PID loop.
See: wikipedia -- Control Theory. - Fast Inverse Square Root: A Magical Algorithm that approximates 1/sqrt(x) quickly. Was found in the OG Quake 3 rendering engine. No longer useful now that we have cpus with hardware funtions. (fast)
See: paper on fast inverse square root.
C# :
- Attributes: A tag that conveys information at runtime; sort of like pre-processor declarations.
See: csharp_attributes tutorial
Optimization :
- False Sharing: When a (global) variable is accessed (shared) by more than one thread. If one thread writes to the variable, each cpu core's cache has to update the variable's data from the ram (slow).
Fix: Always operate on local variables inside a thread. Once the processing is done, use those values to update a global state.
Quip: --Why do you think people say don't use global variables?--
See: using the cpu chache. - Cached Matrixes: If you create a 2-D matrix, it’s row major traversal will be faster than it’s column major traversal. A row is stored in consecutive memory locations and is thus fetched in a cache line.
See: using the cpu chache. - CPU Guesses: A cache is also smart enough to prefetch the previous or next cache line required, depending upon the instruction. So, the more predictable is your access pattern the better will be the performance.
See: using the cpu chache. - Good Cache Knowledge:
- Maintain locality of data. Repeated references to a local variable are good because it'll be in cache.
- Accessing memory in a sequential manner means utilising the already loaded words in cache line and thus, less time accessing the ram.
- Avoid unnecessary memory allocations. Memory is costly and it’s access is not as fast as it seems. Don’t unnecessarily copy objects from one place to another (unless you are dealing with immutable objects in functional programming).
See: using the cpu chache.


public class LinearTraining
extends java.lang.Object
Model
s using different FeatureExtractor
s.| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.String |
featureOutputFile |
protected static java.lang.String |
featureStatisticsFile |
protected static java.lang.String |
labelMappingsFile |
protected static java.lang.String |
modelFile |
protected static java.lang.String |
negativeGazeteerFile |
protected static java.lang.String |
positiveGazeteerFile |
protected static Preprocessor |
preprocessor |
protected static java.lang.String |
tfFile |
protected static java.lang.String |
trainingFile |
protected static boolean |
useCoarseLabels |
| Constructor and Description |
|---|
LinearTraining() |
| Modifier and Type | Method and Description |
|---|---|
protected static java.util.Vector<de.bwaldvogel.liblinear.Feature[]> |
applyFeatures(org.apache.uima.jcas.JCas cas,
java.util.Vector<FeatureExtractor> features)
Applies
FeatureExtractor s to a given CAS. |
protected static de.bwaldvogel.liblinear.Problem |
buildProblem(java.lang.String trainingFile,
java.util.Vector<FeatureExtractor> features)
Builds the
Problem from a training file, using provided FeatureExtractor s. |
protected static de.bwaldvogel.liblinear.Problem |
buildProblem(java.lang.String trainingFile,
java.util.Vector<FeatureExtractor> features,
java.lang.String type)
Builds the
Problem from a training file, using provided FeatureExtractor s. |
protected static de.bwaldvogel.liblinear.Feature[] |
combineInstanceFeatures(java.util.Vector<de.bwaldvogel.liblinear.Feature[]> instanceFeatures)
Helper method to combine
Feature arrays that are produced by several FeatureExtractor s, when applied to a single document. |
protected static java.lang.Double |
getLabelId(java.lang.String label)
Gets the LabelId for a given String label.
|
protected static java.lang.String |
getLabelString(java.lang.Double labelId)
Gets the String label for a given label ID.
|
protected static java.util.Vector<FeatureExtractor> |
loadFeatureExtractors()
Loads and initializes
FeatureExtractor s for training and testing. |
protected static void |
printFeatureStatistics(java.util.Vector<FeatureExtractor> features) |
protected static void |
resetLabelMappings() |
protected static void |
saveFeatureVectors(java.lang.String featureVectorFile,
java.util.Vector<de.bwaldvogel.liblinear.Feature[]> featureVector,
java.util.Vector<java.lang.Double> labels) |
protected static void |
saveLabelMappings(java.lang.String mappingFile)
Saves the label--identifier mappings in a TAB separated file using the following format:
LABEL_ID LABEL Allows for retrieving the original String labels in classification. |
protected static void |
saveModel(de.bwaldvogel.liblinear.Model model,
java.lang.String modelFile)
Saves the
Model in a model file. |
protected static void |
saveModel(de.bwaldvogel.liblinear.Model model,
java.lang.String modelFile,
boolean saveGzipped)
Saves the
Model in a model file. |
protected static de.bwaldvogel.liblinear.Model |
trainModel(de.bwaldvogel.liblinear.Problem problem)
Trains the linear classifier
Model from a given Problem . |
protected static Preprocessor preprocessor
protected static boolean useCoarseLabels
protected static java.lang.String trainingFile
protected static java.lang.String modelFile
protected static java.lang.String labelMappingsFile
protected static java.lang.String featureOutputFile
protected static java.lang.String featureStatisticsFile
protected static java.lang.String tfFile
protected static java.lang.String positiveGazeteerFile
protected static java.lang.String negativeGazeteerFile
protected static java.util.Vector<FeatureExtractor> loadFeatureExtractors()
FeatureExtractor
s for training and testing. Ensures that there is no feature ID overlap between different FeatureExtractor
s.FeatureExtractor
entriesprotected static de.bwaldvogel.liblinear.Problem buildProblem(java.lang.String trainingFile, java.util.Vector<FeatureExtractor> features, java.lang.String type)
Problem
from a training file, using provided FeatureExtractor
s. Stores feature vectors in a file.trainingFile
- path to the training filefeatures
- Vector of FeatureExtractor
stype
- The type of the problem: relevance, sentiment, aspectProblem
, containing the extracted features per instanceprotected static de.bwaldvogel.liblinear.Problem buildProblem(java.lang.String trainingFile, java.util.Vector<FeatureExtractor> features)
Problem
from a training file, using provided FeatureExtractor
s.trainingFile
- path to the training filefeatures
- Vector of FeatureExtractor
sProblem
, containing the extracted features per instanceprotected static void resetLabelMappings()
protected static java.util.Vector<de.bwaldvogel.liblinear.Feature[]> applyFeatures(org.apache.uima.jcas.JCas cas, java.util.Vector<FeatureExtractor> features)
FeatureExtractor
s to a given CAS. Each FeatureExtractor
creates an individual array of Feature
entries.cas
- the CAS that the FeatureExtractor
s operate onfeatures
- a vector of FeatureExtractor
sFeature
array from each FeatureExtractor
protected static de.bwaldvogel.liblinear.Feature[] combineInstanceFeatures(java.util.Vector<de.bwaldvogel.liblinear.Feature[]> instanceFeatures)
Feature
arrays that are produced by several FeatureExtractor
s, when applied to a single document.instanceFeatures
- a Vector of Feature
arrays that should be combinedFeature
array to be used as a training instanceprotected static void saveLabelMappings(java.lang.String mappingFile)
mappingFile
- the path to the fileprotected static java.lang.Double getLabelId(java.lang.String label)
label
- the String labelprotected static java.lang.String getLabelString(java.lang.Double labelId)
labelId
- the label IDprotected static de.bwaldvogel.liblinear.Model trainModel(de.bwaldvogel.liblinear.Problem problem)
Model
from a given Problem
. Returns the trained Model
.problem
- the Problem containing all the training instancesprotected static void saveModel(de.bwaldvogel.liblinear.Model model, java.lang.String modelFile, boolean saveGzipped)
Model
in a model file. The file can be compressed.model
- the model to be savedmodelFile
- path to the output filesaveGzipped
- boolean flag to enable model compression (recommended)protected static void saveModel(de.bwaldvogel.liblinear.Model model, java.lang.String modelFile)
Model
in a model file. By default, compresses model and appends .gz to the filename.model
- the model to be savedmodelFile
- path to the output fileprotected static void saveFeatureVectors(java.lang.String featureVectorFile, java.util.Vector<de.bwaldvogel.liblinear.Feature[]> featureVector, java.util.Vector<java.lang.Double> labels)
protected static void printFeatureStatistics(java.util.Vector<FeatureExtractor> features)


Better than a box of chocolates 7 of our most loved beauty picks
You’ll receive Wander Beauty Wanderess Glow Highlighter, BareMinerals Skinlongevity Vital Power Infusion Serum, A Full-Size NYX Professional Brush* and more when you subscribe to the February Allure Beauty Box.
Plus, new members will receive a FREE Giorgio Armani Rouge D’Armani Matte & Lip Maestro Duo!
|


Support jQuery Development
Your donations help support all development and maintenance activities of the jQuery Project. Thank you for your support!
Donate via Paypal
Some text about donating with PayPal. Thanks for you donation. A little more text would really help fill out this section and make it feel fuller and such.
Donate NowDonate via Check
Please send checks to:
jQuery Foundation
c/o Adam Dworkin, CFO
13 Rhodes Place
Hingham, MA 02043
Make the check payable to: 'jQuery Foundation'


The tiger (Panthera tigris) is the largest cat species, most recognizable for its pattern of dark vertical stripes on reddish-orange fur with a lighter underside.
The Bengal tiger's coat is yellow to light orange, with stripes ranging from dark brown to black; the belly and the interior parts of the limbs are white, and the tail is orange with black rings.
Males have an average total length of 270 to 310 cm (110 to 120 in) including the tail, while females measure 240 to 265 cm (94 to 104 in) on average. The tail is typically 85 to 110 cm


{% extends "layout_2.html" %} {% block ebook %}
This e-book summarizes all the algebra content on this blog. It covers Algebra I and Algebra II high school classes. So it's basically two books in one. The e-book format is pdf, and it's totally free to download.


{{ article.title }}
{{ article.excerpt|replace('
', " ")|replace('
', " ")|replace('
', " ")|trim|raw }} Continue reading » {% if article.topics|length %}- Topics: {% for topic in article.topics %}
- {{ topic }} {% endfor %}
{# # Article index template # ------------------- # # This template is loaded whenever http://example.com/articles is # requested, because it is located at articles/index.html in your # craft/templates/ folder. # # See this page for more details on how Craft routes requests: # http://craftcms.com/docs/routing #} {% extends "_layout" %} {% set title = "Articles" %} {% set articles = craft.entries.section('articles') %} {% set events = craft.entries.section('events') %} {% block content %}
{{ article.excerpt|replace('
', " ")|replace('
', " ")|replace('
', " ")|trim|raw }} Continue reading » {% if article.topics|length %}


NumModel
abstract class NumModel (View source)
NumModel class
Properties
| $error |
Methods
boolean
isEnabled()
Return if a model can be used or not
string
info()
Return the default description of the numbering model
string
getExample()
Return an example of numbering
boolean
canBeActivated()
Check if the numbers already existing in the database doesn't have conflicts with this numbering model
string
getNextValue()
Return next numbering value
string
getVersion()
Return numbering model version
Details
at line 31
boolean
isEnabled()
Return if a model can be used or not
at line 41
string
info()
Return the default description of the numbering model
at line 53
string
getExample()
Return an example of numbering
at line 65
boolean
canBeActivated()
Check if the numbers already existing in the database doesn't have conflicts with this numbering model
at line 75
string
getNextValue()
Return next numbering value
at line 87
string
getVersion()
Return numbering model version


Beepr is a HIPAA-compliant messaging solution built using Catalyze. To learn more about how Catalyze keeps your information protected and encrypted, please visit www.catalyze.io


Organic farming is an alternative agricultural system which originated early 20th century in reaction to changing farming practices.
Donec orci enim, bibendu augue aliquet cursus quam. Pellnteue pulvin condimtum dictusapien nibh auctor tortoris vulputate sapien There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing of Lorem Ipsum, you need
Donec orci enim, bibendu augue aliquet cursus quam. Pellnteue pulvin condimtum dictusapien nibh auctor tortoris vulputate sapien There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing of Lorem Ipsum, you need
Donec orci enim, bibendu augue aliquet cursus quam. Pellnteue pulvin condimtum dictusapien nibh auctor tortoris vulputate sapien There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing of Lorem Ipsum, you need


A mobile app to gamify shopping for healthy foods and reward users with discounts and special offers.


Category on Wikimedia Commons that gathers all contest images. Example of such category may be e.g. "Images from Wiki Loves Monuments 2017 in Ghana".
List of files saved as CSV and uploaded as a Google Sheet or Gist.
List of files, one each line without File: prefix
Whether to show own voting statistics (e.g. number of accepted or declined images) of juror for the round.
{{ ::name | translate }} Minimal resolution
The number of jurors that must vote on each image
Minimal average rating for photo


Class DBSClass
java.lang.Object
DBSClass
- public class DBSClass
- extends java.lang.Object
You do want the characters to improve over time and learn new skills,
right? That's where DBSClass comes in. A character learns moves from this
class. When a character levels up, (s)he gains a skill point, or SP, that
goes to the class. When a character has accumulated enough SP, (s)he learns
a move.
When a character reaches a certain threshold of SP, (s)he can progress a
level in that class. Going up a level means the opprotunity to learn more
powerful versions of previous moves as well as gaining a new Adrenaline
Rush. However, a move cannot be learned in a higher level until it is
learned in a lower level.
For example, Ronyo, a level one White Mage can learn Heal, Cure,
Fireworks, and Life. The Adrenaline Rush for level one is
Flash. For level two, Ronyo can learn Heal2, Protect, Trance, and Life2,
with the Adrenaline being Pierce. However, Ronyo can't learn Life2 until
he's learned Life, or for that matter, he can't learn Protect until he's
learned Cure. In order to get to the high-powered moves, he must go back
to level one and learn the basic versions.
- Version:
- 0.1 Java
- Author:
- Evan Hildreth (root -1 Entertainment)
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SP_Per_Level
public static final int SP_Per_Level
- See Also:
- Constant Field Values
DBSClass
public DBSClass()
DBSClass
public DBSClass(DBSClass job)
- This constructor makes a brand new class using the
attacks from the given class. Used when making new
characters.
DBSClass
public DBSClass(int numLevels,
int atkPerLv,
DBSAttack[] attacks,
int[] costs,
DBSAttack[] rushes)
AdjustedLevel
public int AdjustedLevel()
AtkPerLevel
public int AtkPerLevel()
CanLevelUp
public boolean CanLevelUp()
GetAttack
public DBSAttack GetAttack(int level,
int ind)
GetCost
public int GetCost(int level,
int ind)
GetCurrentRush
public DBSAttack GetCurrentRush()
GetRush
public DBSAttack GetRush(int level)
IsLearned
public boolean IsLearned(int level,
int ind)
Level
public int Level()
LevelDown
public boolean LevelDown()
LevelUp
public boolean LevelUp()
NumLevels
public int NumLevels()
Reset
public void Reset()
SP
public int SP()
SPUp
public void SPUp(DBSCharacter myChar)
TotalSP
public int TotalSP()


I joined a small team of volunteer developers early on, right after Hurricane Harvey made landfall in 2017. The web app helped to coordinate people who needed rescue from high waters with volunteer rescuers. After most people were rescued, we added the Muck Map feature that helped coordinate people who had damaged homes from the flood with volunteer cleaning teams. Thousands of people were helped that week because of our little web app!
During the aftermath of Hurricane Harvey, I joined the API team that created the backend for several different volunteer web apps that were all assisting with various issues related to Hurricane Harvey.
I created a web-based Hangman-type game written in Node.js and Express.js.


a really brief summary
All of the book listed within the bookstack were relevant book for me, but this one was actually crucial for my personal and professional development.
I started reading it after being excluded from a talent program, while I was questioning my ability to construct effective relationship with others and being relevant part of a team.
 This book is rather tyring to teach you how to be a real man, one grounded into sound principles, able to resist ot adverse winds and act proactively, therefore being able to establish sincere and effective relationships with others, being either a single person or a whole team.
This book made me move from a passive-aggressive behaviour to a proactive and effective one
As you may guess everything moves around those seven habits mentioned within the title. Let me thus list you and describe each of them below:
Be proactive
Everything starts from you being proactive. let me show you this with a small sketch This first rules teaches you that between whatever event that affects you and your reaction there is your freedom as an human being. This means that nothing can hurt you if you don’t allow it to do so. This rule teaches you to concentrate on your circle of influence, i.e. on thinkg you can change, rather than sit complying about “bad luck”, worrying about thinkgs you can not change. And if you make a mistake? Aknowledge it , think about how to avoid it the next time and start over. It will be finished only when your eyes will be closed. Applying this habit will let you focus on what you can do to improve your situation, rather than blaming the destiny or your boss. And this will produce a Copernican change and a great relief.Begin with the end in mind
Once you will have practiced with the first rule you will be able to move to the second one, which teaches you how relevant is to base your life on the right basis and principles, avoiding to be moved around from useles and harmful idols like power and money. This rule will help you write your own personal mission to guide you as a star to look at while focusing on your circle of influence and excercising your freedom.
Put thirst things first
The third rule, the last one related to personal success, or independence, helps you apply the first two rules day by day, teaching you how to plan your day to respect your real priorities.
think win-win
whit this rule we move to the public success: you are now a sound person, stable on your principles, able to react positively even to a negative event. It is the time to start interacting positively with the people around you. This rule teaches you how to effectively interact with people moving out from the typical war-game logic. The rules explain how is possibile always to look f or a solution able to satisfy both parties.
You will have to leverage all of your stable and strong characater, the one you will have cultivated with the first three rules, but in the end this approach will help you establish constructive relationshipe and increase your circle of influence.
Seek First to Understand, Then to be Understood
This relevant rule states a simple and powerful thing: you often listen to answer, rather than listening to understand. The rule theaches you how to genuinely listen your counterpart, avoiding to project on his life your own, and rather trying to actually understand which are his experience and feelings. This will give to the speaker some “psychological air”, he will feel finally understood and this will make him ready to listen you and your needs.
You will have then set the stage to effectively interact with the other person, looking for a win win situation.
Synergize
is now time to sum all this up, discovering that in a teamwork the result is greater than the sum of its parts.
has it worked?
As I anticipated this book was crucial for both my professional and personal growth. It let me discover how was acting with other people and which was the right way to handle adverse events. I started focusing only on things I was able to change, committing my whole energies on them, rather than wasting on useless and harmful thoughts.
This, togheter with great concepts from deep work dramatically changed my productivity, helping me focus on really important task at work, but also teaching me to get of office soon enough to get home and play with my kids in the evening.
To be fair, I have to admit that this is not the kind of book you read once in your life: I still often open it and read one or more chapters, trying to fix the concepts and apply them better in the next occasion.
conclusions
I have already reccomended this book to nearly all of my friends and colleagues since as I said this was a really crucial reading for my life. It is therefore easy for me to suggest this book to you as well. I am sure that when you will introduce into your life the seven habits Stephen Covey describes, you will see substantial and relevant changes in your life. As is often the case, you can find the book on Amazon, in english language for sure but probably also in your native language since it is a worldwide success.


Statutory guidance
Statutory guidance for local authorities and advice for other groups on helping children who are missing education get back into it.
Ref: DFE-00214-2016 PDF , 349KB , 24 pages
This statutory guidance is for local authorities. Statutory guidance is issued by law; you must follow it unless you have a good reason not to.
It applies to:
This guidance will help local authorities comply with their legal responsibilities to:
Other organisations or people helping children who are missing education will also find this guidance useful, including:
Published: 26 November 2013
Updated: 5 September 2016


THE ROLE OF THE ASSISTANT ACADEMIC VICE PRESIDENT SAINT LOUIS UNIVERSITY--1972-73
AN ANALYSIS OF AN INTERVENTION
400 PROJECT
W. PATRICK DOLAN
A FINAL REPORT PRESENTED TO THE FACULTY OF THE GRADUATE SCHOOL OF EDUCATION OF HARVARD UNIVERSITY IN PARTIAL FULFILLMENT OF THE REQUIREMENTS FOR THE DEGREE OF DOCTOR OF EDUCATION, 1973


Most popular books with political humor from Amazon
Here you can browse, comment on, and order online the most popular humor books
from Amazon bookstore.
The books are usually available at a considerable discount from the list price.
- 1. Best Editorial Cartoons of the Year 1997 (Issn 0091-2220)
- Charles Brooks (Editor) / Paperback / Published 1997
Amazon Price: $11.96 ~ You Save: $2.99 (20%)
- 3. The Winner of the Slow Bicycle Race : The Satirical Writings of Paul Krassner
- Paul Krassner / Paperback / Published 1997
Amazon Price: $9.56 ~ You Save: $2.39 (20%)
- 4. Read My Lips; A Treasury of Things Politicians Wish They Hadn't Said
- Matthew Parris / Hardcover / Published 1997
Amazon Price: $25.95
(Back Ordered)
- 5. Minor Memos : The Wacky Side of Politics and Power from the Wall Street Journal's Washington Wire
- Ronald G. Shafer (Compiler), Ron Shafer / Paperback / Published 1997
Amazon Price: $7.16 ~ You Save: $1.79 (20%)
- 6. Knee-Deep in Mississippi
- Clay Jones / Paperback / Published 1997
Amazon Price: $7.16 ~ You Save: $1.79 (20%)
- 7. Do I Have to Draw You a Picture?
- Jack Ohman / Paperback / Published 1997
Amazon Price: $7.16 ~ You Save: $1.79 (20%)
(Not Yet Published -- On Order)
- 8. Whos in Charge Here? 1996
- Gerald Gardner / Paperback / Published 1996
Amazon Price: $4.76 ~ You Save: $1.19 (20%)
- 9. Billy Clinton's Letters from Camp
- Peggy Robin, Bill, Jr Adler / Paperback / Published 1997
Amazon Price: $7.16 ~ You Save: $1.79 (20%)
- 10. Dear Mr. President
- Rodney Guge / Paperback / Published 1994
Amazon Price: $5.95
- 11. Cal 98 : Politically Correct Thought for a Day
- James Finn Garner / Calendar / Published 1997
Amazon Price: $7.96 ~ You Save: $1.99 (20%)
(Not Yet Published -- On Order)
- 12. Not Just Another Szep Book
- Paul Michael Szep / Paperback / Published 1997
Amazon Price: $7.16 ~ You Save: $1.79 (20%)
(Not Yet Published -- On Order)
- 13. Confessions of a Lapsed Liberal
- Nicholas J. Nigro / Paperback / Published 1997
Amazon Price: $8.80 ~ You Save: $2.20 (20%)
- 14. Hate Is Not a Family Value : A Quotebook for Liberals in a Right-Wing World
- James D. Hornfischer / Paperback / Published 1997
Amazon Price: $8.76 ~ You Save: $2.19 (20%)
Back to:
Intelligent Humor page
Home
LinkExchange member
This Site is a member of
CyberLink Exchange


Register manifest with annotation store
This page allows you to upload a link to a manifest so that it is registered with the repository. Annotations which are associated with this canvas are then linked to this manifest and also a IIIF Search API endpoint is created.


Source code on GitHub
Doodle Classifier
The Classifier know to classify:
Apple
,
Carrot
,
Banana
,
Pizza
Try to draw one of those objects and the classifier try to guess
Press space to clean


Algorithm 1.1 General optimization algorithm
Step 1:
(a) Set \(k=0\) and initialize \(x_0\)
(b) Compute \(F_0=f(x_0)\)
Step 2:
(a) Set \(k=k+1\)
(b) Compute the changes in \(x_k\) given by column vector \(\nabla x_k\)
\[ \text {where} \quad \nabla x_k^T = \begin {bmatrix}\nabla x_1 & \nabla x_2 & \cdots & \nabla x_n\end {bmatrix} \]
by using an appropriate procedure.
(c) Set \(x_k=x_{k-1}+\nabla x_k\)
(d) Compute \(F_k=f(x_k)\) and \(\nabla F_k=F_{k-1}-F_k\).
Step 3:
Check if convergence has been achieved by using an appropriate criterion, e.g., by checking \(\nabla F_k\) and/or \(\nabla x_k\). If this is the case, continue to Step 4; otherwise, go to Step 2.
Step 4:
(a) Output \(x^* = x_k\) and \(F^* = f(x^*)\).
(b) Stop
Gradient: \(g(x)=\nabla f(x)=\begin {bmatrix}\frac {\partial f}{\partial x_1} & \frac {\partial f}{\partial x_2} & \cdots & \frac {\partial f}{\partial x_n} \end {bmatrix}^T\)
Hessian Matrix: \(H(x)=\nabla g(x)=\nabla \{ \nabla ^T f(x)\}\).
\[ H(x)= \begin {bmatrix} \frac {\partial ^2 f}{\partial ^2 x_1} & \frac {\partial ^2 f}{\partial x_1 \partial x_2} & \cdots & \frac {\partial ^2 f}{\partial x_1 \partial x_n} \\ \frac {\partial ^2 f(x)}{\partial x_2 \partial x_1} & \frac {\partial ^2 f(x)}{\partial x_2^2} & \cdots & \frac {\partial f}{\partial x_2 \partial x_n} \\ \vdots & \vdots & \ddots & \vdots \\ \frac {\partial f}{\partial x_n \partial x_1}& \frac {\partial f}{\partial x_n \partial x_2}& \cdots & \frac {\partial f}{\partial x_n \partial x_n} \end {bmatrix} \]
Taylor Series: (quad approx, linear approx): \(\delta =\begin {bmatrix} \delta _1 &\delta _2 \end {bmatrix}^T\) \(f(x + \delta ) = f(x) + g(x)^T\delta + 12\delta ^TH(x)\delta + o(||\delta ||^2)\)
Linear approximation: \(f(x + \delta ) \approx f(x) + g(x)^T\delta \)
\(\tilde {x}=x+\delta \quad \delta =\tilde {x}-x\) \(\hat {f}(\tilde {x})=f(x)+g(x)(\tilde {x}-x)^T+0.5(\tilde {x}-x)^T H(x)(\tilde {x}-x)^T\) The gradient \(g(x)\) and the Hessian \(H(x)\) must satisfy certain conditions
at a local minimizer \(x^*\).
1. Conditions which are satisfied at a local minimizer \(x^*\).
2. Conditions which guarantee that \(x^*\) is a local minimizer.
Definition 2.1 A point \(x^* \in R,\) where R is the feasible region, is said to be a weak local minimizer of f(x) if there exists a distance \(\epsilon > 0\) such that \(f(x) \geq f(x^*)\) (2.5) if \(x \in R\) and \(||x-x^*||
< \epsilon \)
Definition 2.2 A point \(x^* \in R \) is said to be a weak global minimizer of f(x) if \(f(x) \geq f(x^*)\) (2.6) for all \(x \in R.\)
Definition 2.3
If Eq. (2.5) in Def. 2.1 or Eq. (2.6) in Def. 2.2 is replaced by \(f(x) > f(x^*)\) (2.7) \(x^*\) is said to be a strong local (or global) minimizer. d
Definition 2.4 Let \(\delta = \alpha \mathbf {d}\) be a change in x where \(\alpha \) is a positive constant and d is a direction vector. If R is the feasible region and a constant \(\hat {\alpha } > 0\) exists such that
\(x + \alpha d \in R\) for all \(\alpha \) in the range \(0 \leq \alpha \leq \hat {\alpha }\) , then d is said to be a feasible direction at point x.
Definition 2.5
(a) Let \(d\) be an arbitrary direction vector at point \(x\). The quadratic form \(d^TH(x)d\) is said to be positive definite, positive semidefinite, negative semidefinite, negative definite if \(d^TH(x)d > 0, \geq 0, \leq 0,
< 0,\) respectively, for all \(d \neq 0\) at \(x\). If \(d^TH(x)d\) can assume positive as well as negative values, it is said to be indefinite.
(b) If \(d^TH(x)d\) is positive definite, positive semidefinite, etc., then matrix \(H(x)\) is said to be positive definite, positive semidefinite, etc.
The objective function must satisfy two sets of conditions in order to have a minimum, namely, first- and second-order conditions.
First-order necessary conditions for a minimum
(a) If \(f(x) \in C^1\) and \(x^*\) is a local minimizer, then \(g(x^*)^Td \geq 0\) for every feasible direction \(d\) at \(x^*\).
(b) If \(x^*\) is located in the interior of \(\mathcal {R}\) then \(g(x^*) = 0\)
Second-order necessary conditions for a minimum
(a) If \(f(x) \in C_2\) and \(x^*\) is a local minimizer, then for every feasible direction d at \(x^*\).
\((i) \ g(x^*)Td \geq 0\)
\((ii)\) If \(g(x^*)^Td = 0\), then \(d^TH(x^*)d \geq 0\)
(b) If \(x^*\) is a local minimizer in the interior of R, then
\((i)\) \(g(x^*) = 0\)
\((ii)\) \(d^TH(x^*)d \geq 0\) for all \(d \neq 0\)
Second-order sufficient conditions for a minimum
If \(f(x) \in C_2\) and \(x^*\) is located in the interior of \(\mathcal {R}\), then the conditions (a) \(g(x^*) = 0\) (b) \(H(x^*)\) is positive definite are sufficient for \(x^*\) to be a strong local minimizer.
Definition 2.6
A point \(\bar {x} \in \mathcal {R},\) where \(\mathcal {R}\) is the feasible region, is said to be a saddle point if
(a) \(g(\bar {x}) = 0\)
(b) point \(\bar {x}\) is neither a maximizer nor a minimizer.
Stationary points can be located and classified as follows:
1. Find the points \(x_i\) at which \(g(x_i) = 0\).
2. Obtain the Hessian \(H(x_i)\).
3. Determine the character of \(H(x_i)\) for each point \(x_i\).
If \(H(x_i)\) is positive (or negative) definite, \(x_i\) is a minimizer (or maximizer); if \(H(x_i)\) is indefinite, \(x_i\) is a saddle point.
Techniques to compute Hessian P.D. , N.D.
Eigenvalues: det \((\lambda I -A) = 0\) Multiplying all eigenvalues is equal to the determinant.
The leading principal minors of a matrix A or its negative \(-A\) can be used to establish whether the matrix is positive or negative definite whereas the principal minors of A or \(-A\) can be used to establish whether the matrix is
positive or negative semidefinite.
Theorem 2.9 Properties of matrices
(a) If H is positive semidefinite or positive definite, then det \(\mathbf {H} \geq 0 \ \text {or} > 0\)
(b) H is positive definite if and only if all its leading principal minors are positive, i.e., det \(\mathbf {H_i} > 0\) for \(i = 1, 2, \cdots , n.\)
(c) H is positive semidefinite if and only if all its principal minors are nonnegative, i.e., det \((H_i^{(l)}) \geq 0\) for all possible selections of \(\{l_1, l_2, \cdots , l_i \}\) for \(i = 1, 2, \cdots , n\).
(d) H is negative definite if and only if all the leading principal minors of \(-\mathbf {H}\) are positive, i.e., \(det ( -H_i) > 0\) for \(i = 1, 2, \cdots , n\).
(e) H is negative semidefinite if and only if all the principal minors of -\(\mathbf {H}\) are nonnegative, i.e., det \((-H_i^{(l)}) \geq 0\) for all possible selections of \(\{l_1, l_2, \cdots , l_i \}\) for \(i = 1, 2, \cdots ,
n\).
(f) H is indefinite if neither (c) nor (e) holds.
Definition 2.7
A set \(\mathcal {R}_c \subset E_n \) is said to be convex if for every pair of points \(x_1, x_2 \subset R_c\) and for every real number \(\alpha \) in the range \(0 < \alpha < 1\), the point \(x = \alpha x_1 + (1 - \alpha
)x_2\) is located in \(\mathcal {R}_c \), i.e., \(x \in \mathcal {R}_c\).
Definition 2.8
(a) A function \(f(x)\) defined over a convex set \(\mathcal {R}_c\) is said to be convex if for every pair of points \(x_1, x_2 \in \mathcal {R}_c \) and every real number \(\alpha \) in the range \(0 < \alpha < 1\), the
inequality \(f[\alpha x_1 + (1 - \alpha )x_2] \leq \alpha f(x_1) + (1 - \alpha )f(x_2)\) holds. If \(x_1 \neq x_2\) and \(f[\alpha x_1 + (1 - \alpha )x_2] < \alpha f(x_1) + (1 - \alpha )f(x_2)\) then f(x) is said to be strictly
convex.
(b) If \(\phi (x)\) is defined over a convex set \(\mathcal {R}_c\) and f(x) = -\(\phi (x)\) is convex, then \(\phi (x)\) is said to be concave. If f(x) is strictly convex, \(\phi (x)\) is strictly concave.
Property of convex functions relating to the Hessian A function \(f(x) \in C^2\)is convex over a convex set \(\mathcal {R}_c\) if and only if the Hessian H(x) of f(x) is positive semidefinite for \(x \in \mathcal
{R}_c.\)
Theorem 2.15 Relation between local and global minimizers in convex functions
If \(f(x)\) is a convex function defined on a convex set \(\mathcal {R}_c\), then
(a) the set of points \(S_c\) where \(f(x)\) is minimum is convex;
(b) any local minimizer of \(f(x)\) is a global minimizer.
Dichotomous Search
Two function evaluations per iteration.
A unimodal function on an interval has exactly one point where a maximum or minimum occurs in the interval.
Consider a unimodal function which is known to have a minimum in the interval \([x_L, \ x_U]\). This interval is said to be the range of uncertainty.
In this method, f(x) is evaluated at two points \(x_a = x_1 - \epsilon /2\) and \(x_b = x_1 +\epsilon /2\) where \(\epsilon \) is a small positive number. Then depending on whether \(f(x_a) < f(x_b)\) or \(f(x_a) >
f(x_b)\), range \(x_L\) to \(x_1 + \epsilon /2\) or \(x_1 - \epsilon /2\) to \(x_U\) can be selected and if \(f(x_a) = f(x_b)\) either will do fine. If we assume that \(x_1 - x_L = x_U - x_1\), i.e., \(x_1 = (x_L + x_U)/2\),
the region of uncertainty is immediately reduced by half. The same procedure can be repeated for the reduced range, that is, f(x) can be evaluated at \(x_2 - \epsilon /2\) and \(x2 + \epsilon /2\) where \(x_2\) is located at the
center of the reduced range, and so on.
Algorithm 4.1 Fibonacci
Computing n =\(I_n=\frac {I_1}{F_n}\), function evaluations = n-1
Step 1
Input \(x_{L,1}, x_{U,1}\), and n.
Step 2
Compute \(F_1, F_2, \cdots , F_n\) using Eq. (4.4).
Step 3
Assign \(I_1 = x_{U,1} - x_{L,1}\) and compute
\( \seteqsection {5} \)
\begin{align*} & I_2 = \frac {F_{n -1}}{F_n}I_1 (\text {see Eq. (4.6)})\\ & x_{a,1} = x_{U,1} - I_2, \quad x_{b,1} = x_{L,1} + I_2\\ & f_{a,1} = f(x_{a,1}), \quad f_{b,1} = f(x_{b,1}) \end{align*}
Set k = 1.
Step 4
Compute \(I_{k+2}\) using Eq. (4.6). If \(f_{a,k} \geq f_{b,k}\), then update Eqs. (4.7) to (4.12) using
\( \seteqsection {5} \)
\begin{align*} & x_{L,k+1}=x_{a,k} \\ & x_{U,k+1}=x_{U,k} \\ & x_{a,k+1}=x_{b,k} \\ & x_{b,k+1}=x_{L,k+1}+I_{k+1} \\ & f_{a,k+1}=f_{b,k} \\ & f_{b,k+1}=f(x_{b,k+1}) \end{align*}
using Otherwise, if \(f_{a,k} < f_{b,k}\), update information using Eqs. (4.13) to (4.18) using
\( \seteqsection {5} \)
\begin{align*} & x_{L,k+1}=x_{L,k} \\ & x_{U,k+1}=x_{b,k} \\ & x_{a,k+1}=x_{U,k+1}-I_{k+2} \\ & x_{b,k+1}=x_{a,k} \\ & f_{a,k+1}=f(x_{a,k+1}) \\ & f_{b,k+1}=f_{a,k} \end{align*}
Step 5
If \(k = n - 2\) or \(x_{a,k+1} > x_{b,k+1}\), output \(x^* = x_{a,k+1}\) and \(f^* = f(x^*)\), and stop. Otherwise, set \(k = k + 1\) and repeat from Step 4. The condition \(x_{a,k+1} > x_{b,k+1}\) implies that
\(x_{a,k+1} \approx x_{b,k+1}\) within the precision of the computer used, as was stated earlier, or that there is an error in the algorithm. It is thus used as an alternative stopping criterion.
Algorithm 4.2 Golden-section search
(function evaluations = k+1) and Golden Ratio: \(K=\cfrac {1+\sqrt {5}}{2}\) \(\Lambda _{GS} = I_n = \frac {I_1} {K_{n-1}}\) \(\Lambda _{F} = I_n = \frac {I_1} {F_n} \approx \frac {\sqrt {5}}
{K^{n+1}}I_1\) \(\frac {I_k}{I_{k+1}}=\frac {I_{k+1}}{I_{k+2}} = \frac {I_{k+2}}{I_{k+3}} = \cdots = K\)
Step 1
Input \(x_{L,1}, x_{U,1},\) and \(\epsilon \).
Step 2
Assign \(I_1 = x_{U,1} - x_{L,1}, K = 1.618034\) and compute
\( \seteqsection {5} \)
\begin{align*} &I_2 = I_1/K \\ &x_{a,1} = x_{U,1} - I_2, \quad x_{b,1} = x_{L,1} + I_2 \\ &f_{a,1} = f(x_{a,1}), \quad f_{b,1} = f(x_{b,1}) \end{align*}
Set \(k = 1\).
Step 3
Compute \(I_{k+2} = I_{k+1}/K\)
If \(f_{a,k} \geq f_{b,k}\), then update \(x_{L,k+1}, x_{U,k+1}\), \(x_{a,k+1}\), \(x_{b,k+1}\), \(f_{a,k+1}\), and \(f_{b,k+1}\) as
\( \seteqsection {5} \)
\begin{align*} & x_{L,k+1}=x_{a,k} \\ & x_{U,k+1}=x_{U,k} \\ & x_{a,k+1}=x_{b,k} \\ & x_{b,k+1}=x_{L,k+1}+I_{k+1} \\ & f_{a,k+1}=f_{b,k} \\ & f_{b,k+1}=f(x_{b,k+1}) \end{align*}
Or use using Eqs. (4.7) to (4.12). Otherwise if \(f_{a,k} < f_{b,k}\), then update \(x_{L,k+1}, x_{U,k+1}\), \(x_{a,k+1}\), \(x_{b,k+1}\), \(f_{a,k+1}\), and \(f_{b,k+1}\) as
\( \seteqsection {5} \)
\begin{align*} & x_{L,k+1}=x_{L,k} \\ & x_{U,k+1}=x_{b,k} \\ & x_{a,k+1}=x_{U,k+1}-I_{k+2} \\ & x_{b,k+1}=x_{a,k} \\ & f_{a,k+1}=f(x_{a,k+1}) \\ & f_{b,k+1}=f_{a,k} \end{align*}
Otherwise, if \(f_{a,k} < f_{b,k}\), update information using Eqs. (4.13) to (4.18).
Step 4
If \(I_k < \epsilon \) or \(x_{a,k+1} > x_{b,k+1}\), then do:
If \(f_{a,k+1} > f_{b,k+1}\), compute \(x^* = 0.5(x_{b,k+1} + x_{U,k+1})\)
If \(f_{a,k+1} = f_{b,k+1}\), compute \(x^* = 0.5(x_{a,k+1} + x_{b,k+1})\)
If \(f_{a,k+1} < f_{b,k+1}\), compute \(x^* = 0.5(x_{L,k+1} + x_{a,k+1})\) Compute \(f^* = f(x^*).\)
Output \(x^*\) and \(f^*\), and stop.
Step 5
Set \(k = k + 1\) and repeat from Step 3.
Equations 4.4, 4.6, (4.7-4.12) and (4.13-4.18)
\(F_k = F_{k-1} + F_{k-2} \quad \) for \(k \geq 2\) (4.4)
\(I_{k+2} = \frac {F_{n-k-1}}{F_{n-k}}I_{k+1} (4.6)\)
If \(f_{a,k} > f_{b,k}\), then \(x^*\) is in interval \([x_{a,k}, x_{U,k}]\) and so the new bounds of \(x^* \rightarrow \) \(x_{L,k+1} = x_{a,k} (4.7) \quad x_{U,k+1} = x_{U,k} (4.8)\) Similarly, the two interior points
of the new interval, namely, \(x_{a,k+1}\) and \(x_{b,k+1}\) will be \(x_{b,k}\) and \(x_{L,k+1} + I_{k+2}\), respectively. We can thus assign \(x_{a,k+1} = x_{b,k}\) (4.9) \(x_{b,k+1} = x_{L,k+1} + I_{k+2}\) (4.10)
as illustrated in Fig. 4.5.
The value \(f_{b,k}\) is retained as the value of f(x) at \(x_{a,k+1}\), and the value of f(x) at \(x_{b,k+1}\) is calculated, i.e., \(f_{a,k+1} = f_{b,k}\) (4.11) \(f_{b,k+1} = f(x_{b,k+1})\) (4.12)
On the other hand, if \(f_{a,k} < f_{b,k}\), then \(x^*\) is in interval \([x_{L,k}, x_{b,k}]\). In this case, we assign \(x_{L,k+1} = x_{L,k}\) (4.13) \(x_{U,k+1} = x_{b,k}\) (4.14) \(x_{a,k+1} = x_{U,k+1} - I_{k+2}\)
(4.15) \(x_{b,k+1} = x_{a,k}\) (4.16) \(f_{b,k+1} = f_{a,k}\) (4.17) and calculate \(f_{a,k+1} = f(x_{a,k+1})\) (4.18)
Algorithm 4.6 Inexact line search
Step 1:
Input \(x_k\), \(d_k\), and compute \(g_k\).
Initialize algorithm parameters \(\rho , \sigma , \tau \), and \(\chi \).
Set \(\alpha _L = 0\) and \(\alpha _U = 10^{99}\).
Step 2:
Compute \(f_L = f(x_k + \alpha _L dk)\).
Compute \(f_L^\prime = g(x_k + \alpha _L dk)^Tdk\).
Step 3:
Estimate \(\alpha _0\).
Step 4:
Compute \(f_0 = f(x_k + \alpha _0dk)\).
Step 5 (Interpolation)
If \(f_0 > f_L + \rho (\alpha _0 - \alpha _L)f_L^\prime \) , then do:
a. If \(\alpha _0 < \alpha _U\), then set \(\alpha _U = \alpha _0\).
b. Compute \(\breve {\alpha }_0\) using the interpolation formula Eq. (4.57).
\[ \breve {\alpha }_0 =\alpha _L + \frac {(\alpha _0-\alpha _L)^2f_L^\prime }{2[f_L-f_0+(\alpha _0-\alpha _L)f_L^\prime ]} \]
c. If \(\breve {\alpha }_0 < \alpha _L + \tau (\alpha _U - \alpha _L)\) then set \(\breve {\alpha }_0 = \alpha _L + \tau (\alpha _U - \alpha _L)\).
d. If \(\breve {\alpha }_0 > \alpha _U - \tau (\alpha _U - \alpha _L)\) then set \(\breve {\alpha }_0 = \alpha _U - \tau (\alpha _U - \alpha _L)\).
e. Set \(\alpha _0 = \breve {\alpha }_0\) and go to Step 4.
Step 6
Compute \(f_0^\prime = g(x_k + \alpha _0dk)^Tdk\).
Step 7 (Extrapolation)
If \(f_0^\prime < \alpha f_L^\prime \) , then do:
a. Compute \(\nabla \alpha _0 = (\alpha _0 - \alpha _L)f_0^\prime /(f_L^\prime - f_0^\prime )\) (see Eq. (4.58)).
\[ \breve {\alpha }_0 = \alpha _0 + (\alpha _0 - \alpha _L)f_0^\prime (f_L^\prime - f_0^\prime ) \quad (Eq. (4.58)) \]
b. If \(\nabla \alpha _0 < \tau (\alpha _0 - \alpha _L)\), then set \(\nabla \alpha _0 = \tau (\alpha _0 - \alpha _L)\).
c. If \(\nabla \alpha _0 > \chi (\alpha _0 - \alpha _L)\), then set \(\nabla \alpha _0 = \chi (\alpha _0 - \alpha _L)\).
d. Compute \(\breve {\alpha }_0 = \alpha _0 + \nabla \alpha _0\).
e. Set \(\alpha _L = \alpha _0, \alpha _0 = \breve {\alpha }_0, f_L = f_0, f_L^\prime = f_0^\prime \), and go to Step 4.
Step 8
Output \(\alpha _0\) and \(f_0 = f(x_k + \alpha _0dk)\), and stop.
Standard form: \(f(x)=\frac {1}{2}x^T H x + x^T g(x) + C\)
Rate of Convergence \(\beta = (1-r^2)/(1+r^2)\), where r is the smallest eigenvalue divided by the biggest eigenvalue.
\( \seteqsection {5} \)
\begin{align*} & H^{-1}=\begin {bmatrix} a & c \\ c & b \end {bmatrix}^{-1} = \frac {1}{ab-c^2} \begin {bmatrix} b & -c \\ -c & a \end {bmatrix} \quad ab-c^2 \neq 0 \end{align*}
\([f(x_k)-f(x^*)]\leq \left (\frac {1-r}{1+r}\right )^2[f(x_k)-f(x^*)]\)
Algorithm 5.1 Steepest-descent algorithm
Step 1
Input \(x_0\) and initialize the tolerance \(\epsilon \).
Set \(k = 0\).
Step 2
Calculate gradient \(g_k\) and set \(d_k=-g_k\).
Step 3
Find \(\alpha _k\), the value of \(\alpha \) that minimizes \(f(x_k + \alpha d_k)\), using a line search (Algorithm Inexact Line Search. 4.6).
Step 4
Set \(x_{k+1} = x_k + \alpha _k d_k\) and calculate \(f_{k+1} = f(x_{k+1})\).
Step 5
If \(||\alpha _k d_k|| < \epsilon \), then do:
Output \(x^* = x_{k+1}\) and \(f(x^*) = f_{k+1}\), and stop.
Otherwise, set \(k = k + 1\) and repeat from Step 2.
Algorithm 5.3 Basic Newton algorithm
Step 1
Input \(x_0\) and initialize the tolerance \(\epsilon \)
Set \(k = 0\).
Step 2
Compute \(g_k\) and \(H_k\).
If \(H_k\) is not positive definite, force it to become positive definite.
Step 3
Compute \(H_k^{-1}\) and \(d_k=-H_k^{-1}g_k\)
Step 4
Find \(\alpha _k\) , the value of \(\alpha \) that minimizes \(f(x+\alpha d_k)\), using a line search.
Step 5
Set \(x_{k+1}=x_k+\alpha _k d_k\)
Compute \(f_{k+1}=f(x_{k+1})\).
Step 6
If \(||\alpha _k d_k|| < \epsilon \), then do:
Output \(x^*=x_{k+1}\) and \(f(x^*)=f(x_{k+1})\), and stop
Otherwise, set \(k = k + 1\) and repeat from Step 2.
Algorithm 5.5 Gauss — Newton Algorithm
\(f=\begin {bmatrix} f_1(x) & f_2(x) & \cdots f_m(x) \end {bmatrix}^T\), J = Jacobian
\(F(x)=\sum _{p=1}^{m}f_p(x)^2=f^Tf\)
\(J=\begin {bmatrix} \frac { \partial f_1}{\partial x_1} & \frac { \partial f_1}{ \partial x_2} & \cdots & \frac {\partial f_1}{\partial x_n} \\ \frac {\partial f_2}{\partial x_1} & \frac {\partial
f_2}{\partial x_2} & \cdots & \frac {\partial f_2}{\partial x_n} \\ \vdots & \vdots & \ddots & \vdots \\ \frac {\partial f_m}{\partial x_1}& \frac {\partial f_m}{\partial x_2}& \cdots
& \frac {\partial f_m}{\partial x_n} \end {bmatrix}\)
Step 1
Input \(x_0\) and initialize the tolerance \(\epsilon \).
Set \(k = 0\).
Step 2
Compute \(f_{pk} = f_p(x_k)\) for \(p = 1, 2, \cdots , m\) and \(F_k\).
Step 3
Compute \(J_k, g_k = 2J^T_k f_k\), and \(H_k = 2J^T_k J_k\).
Step 4
\(d_k=-H_k^{-1}g_k\)
Step 5
Find \(\alpha _k\), the value of \(\alpha \) that minimizes \(f(x_k + \alpha d_k)\).
Step 6
Set \(x_{k+1} = x_k + \alpha _kd_k\).
Compute \(f_{p,k+1}\) for \(p = 1, 2,\cdots , m\) and \(F_{k+1}\).
Step 7
If \(|F_{k+1}-F_k | < \epsilon \), then do:
Output \(x^*= x_{k+1}\), \(f_{p,k+1}(x^*)\) for \(p = 1, 2,\cdots , m\), and \(F_{k+1}\).
Stop.
Otherwise, set \(k = k + 1\) and repeat from Step 3.
Problems with Rank-one Method
1. positive definite \(S_k\) may not yield positive definite \(S_{k+1}\)
2. denominator in correction formula may approach zero
THE DFP and BFGS are implementing of the basic algorithms Quasi Newton (7.2) with changes to the updating function. \(d_k=-S_kg_k\) and \(f(x_k + \alpha d_k)\) \(\rightarrow \) \(\alpha _k=\frac {g_k^TS_kg_k}
{g_k^TS_kHS_kg_k}\)
Convergence equation: \(\beta = \left (\frac {1-r}{1+r}\right )^2\) \(f(x_{k+1})-f(x^*) \leq \left (\frac {1-r}{1+r}\right )^2[f(x_k)-f(x^*)]\)
BFGS and then DFP properties
For convex quadratic functions (BFGS)
— \(Sk+1\) becomes identical to \(H^{-1}\) for \(k = n-1\).
— Directions \(\delta _0,\delta _1,\cdots ,\delta _{n-1}\) form a conjugate set.
— \(S_{k+1}\) is positive definite if \(S_k\) is positive definite.
— \(\delta ^T_k \gamma _k = \delta ^T_k g_{k+1}-\delta _T^k g_k > 0\) applies.
For DFP (from textbook)
1. If \(S_k\) is PD, then the matrix \(S_{k+1}\) generated by DFP is also PD.
2. Directions \(\delta _0,\delta _1,\cdots ,\delta _{n-1}\) form a conjugate set.
Algorithm 7.2 adjusted for DFP/BFGS
Step 1
Input \(x_0\) and initialize the tolerance \(\epsilon \).
Set \(k = 0\) and \(S_0 = I_n\).
Compute \(g_0\).
Step 2
Set \(d_k=-S_kg_k\)
Find \(\alpha _k\), the value of \(\alpha \) that minimizes \(f(x_k+\alpha d_k)\), using a line search
Set \(\delta _k=\alpha _k d_k\) and \(x_{k+1}=x_k+\delta _k\)
Step 3
If \(||\delta _k|| < \epsilon \), output \(x^* = x_{k+1}\) and \(f(x^*) = f(x_{k+1})\), and stop
Step 4
Compute \(g_{k+1}\) and set \(\gamma _k=g_{k+1}-g_k\)
Compute \(S_{k+1}\) using appropriate formula.
\( \seteqsection {5} \)
\begin{align*} &\text {Basic/ Rank One:} \quad S_{k+1}=S_k+\frac {(\delta _k-S_k \gamma _k)(\delta _k-S_k \gamma _k)^T}{\gamma _k^T(\delta _k-S_k\gamma _k)}\\ &\text {DFP:}\quad S_{k+1}=S_k+\frac {\delta _k \delta _k^T}{\delta _k^T \gamma _k}-\frac {S_k\gamma _k\gamma _k^TS_k}{\gamma _k^TS_k\gamma _k}\\ &\text {BFGS:} \quad S_{k+1}=S_k+\left (1+\frac {\gamma _k^TS_k\gamma _k}{\gamma _k^T\delta _k}\right )\frac {\delta _k\delta _k^T}{\gamma _k^T\delta _k}-\frac {(\delta _k\gamma _k^TS_k+S_k\gamma _k\delta _k^T)}{\gamma _k^T\delta _k} \end{align*}
Set \(k=k+1\) and repeat from Step 2.
— remember that \(\left (1+\frac {\gamma _k^TS_k\gamma _k}{\gamma _k^T\delta _k}\right )\) is a single number
— \(\delta _k\delta _k^T\) is a matrix.
— Focus on minimization, \(\max [f(x)] =-\min [-f(x)]\)
— Hessian is positive semidefinite for concave functions.


Lorem ipsum, or lipsum as it is sometimes known, New York Times is dummy text used in laying out print, graphic or web designs. The passage is attributed to an unknown typesetter in the 15th century who is thought to have scrambled parts of Cicero's De Finibus Bonorum et Malorum for use in a type specimen book. It usually begins with:
Lorem ipsum, or lipsum as it is sometimes known, New York Times is dummy text used in laying out print, graphic or web designs. The passage is attributed to an unknown typesetter in the 15th century who is thought to have scrambled parts of Cicero's De Finibus Bonorum et Malorum for use in a type specimen book. It usually begins with:
Lorem ipsum, or lipsum as it is sometimes known, is dummy text used in laying out print or web designs.
Lorem ipsum, or lipsum as it is sometimes known, is dummy text used in laying out print, graphic or web designs. The passage is attributed to an unknown typesetter in the 15th century who is thought to have scrambled Google parts of Cicero's De Finibus Bonorum et Malorum for use in a type specimen book. It usually begins with:
The Catcher in the Rye
Ulysses
The Plague


PG-Buses
Unfortunately the source code for this project is in a private repository as there are plans to make improvements
This project served as a way to explore mobile and web development while building something useful for residents of our town. I was part of a team that designed, developed, and deployed this app using the Agile methodology.
This app was developed over two courses. During the first course, I helped develop the initial schedule and route pages. The initial course was my introduction to many new technologies such as JavaScript, Ionic, and Angular. Because of my, and my team members’, unfamiliarity with these technologies, development was slow. By the end of the first course we had a usable product, however many ideas and plans were left out in order to have a working prototype.
During the second course we were able to implement many more features. My responsibilities also shifted at this time. I was tasked with sourcing our data from PG Transit and making it usable for our purposes.
The transit data was received in a JSON format. We were initially working with this data as it was received from PG Transit without any modification. Since these JSON files are very large, and our app is really just a front end, processing times caused the application to hang. For instance, when we wanted to populate a map with all of the stops on a route the application would eventually complete it’s task on newer, more powerful, devices but simply crash on older ones.
Unfortunately, no one in the group had been exposed to databases at the time so a decision was made to continue using the JSON files rather than try to implement new (to us) technology. This meant that we would have to make the JSON files more manageable. I wrote a small Python program that would take the JSON files and break them down into more manageable chunks that could be processed more easily. Throughout development as other team members worked on their contributions I would get requests to modify or generate JSON files for them. I would also work with each team member to help them implement their ideas using the data we had. This involved using Angular to parse the JSON files and capture the correct information then present it properly on the page. With the smaller files in place we were able to add the functionality we wanted without long processing times.
The real test of my Python program came when PG Transit updated their information for a new season. I was able to get the original JSON files, run my program and import the new files without any conflicts. The next step would be writing a service that listens for these changes, runs the python program and pushes the new changes.
All of the information provided by the app about routes, schedules, and stops come from this data set. After taking a course in databases I can see how this app would have improved with one, as working with the JSON files proved to be difficult in some cases.
Below is a gallery showing some of the pages that use the JSON data.
Gallery


Loch Ness Marathon
Inverness SCO
Website: www.lochnessmarathon.com
Race Winners
(14 runnings)
Notes: 2002 was the inaugural year. The course is point-to-point,
from a point west of Foyers and proceeding east to Inverness, dropping 7.9 m/km.
27 Sep
2015
2:25:19
Elly Tarus -2
2:44:50
Megan Crawford-2
28 Sep
2014
2:22:41
Tomas Abyu-4
2:46:10
Jennifer Emsley (SCO)
29 Sep
2013
2:27:21
Elly Tarus (KEN)
2:46:37
Megan Crawford (SCO)
30 Sep
2012
2:20:24
Ross Houston (SCO)
2:54:54
Avril Mason (SCO)
02 Oct
2011
2:20:50
Tomas Abyu-3
2:59:14
Lisa Finlay (SCO)
03
Oct
2010
2:20:50
Tomas Abyu-2
2:46:39
Dinknesh Tefera Mekash (ETH)
04
Oct
2009
2:20:13
Simon Tanui (KEN)
2:48:25
Joyce Kirui (KEN)
05 Oct
2008
2:28:03
Ezekiel Cherop (KEN)
2:51:23
Banuela
Katesigwa-2
07 Oct
2007
2:23:17
Zachary Kihara
Njoroge-2
2:55:04
Banuela Katesigwa (TAN)
01 Oct
2006
2:22:17
Zachary Kihara Njoroge (KEN)
2:46:54
Helen Cherono (KEN)
02 Oct
2005
2:30:15
Simon Pride-2
2:51:52
Julia Myatt (ENG)
03
Oct 2004
2:27:58
Simon Pride (SCO)
2:59:57
Jan Roxburgh ISCO)
28 Sep 2003
2:20:59
Tomas Abyu (ETH)
2:50:42
Trudi Thomson (SCO)
29 Sep 2002
2:33:36
Eric Kiplagat (KEN)
2:57:06
Addy Gerrard (SCO)
Most Wins (2002-date)
Men
4
Tomas Abyu (ETH)
2003,2010-11,2015
Women
2
Banuela Katesigwa (TAN)
2007-08
Prize Money
(ADR qualified runners)
Year Men Women Total 2015 $4,175 $3,565 $7,740 2014 3,150 3,115 6,265 2013 4,275 4,980 9,255 .... 2011 3,510 3,510 7,020 2010 3,560 3,560 7,120 .... 2008 5,100 5,500 10,600 Sums $23,770 $24,230 $48,000
Race Time Bias
(sec/km)
Insufficient data to calculated the race time bias.
Competitive Level
(1990-date)
Insufficient data to calculated the competitive level.
Quality Performances
Men
No men under 2:20
Women
<2:46 1
<2:48 7
<2:50 8
Note: The net drop is excessive for this course.
Finishers
Year Men Women M+F 2015 2422 2014 1588 889 2487 2013 1837 860 2697 2012 1732 819 2551 2011 1633 714 2347 2010 1719 769 2488 2009 1505 652 2157 2008<PHONE_NUMBER> 2007 1008 418 1426 2006<PHONE_NUMBER> 2005<PHONE_NUMBER> 2004 691<PHONE_NUMBER> 623<PHONE_NUMBER> 550 Sum 24568 Sums 14964 6632 21596 M/F 2.26
Inverness-Forres Marathon
Race Winners
(9 runnings)
06 Jul
1974
07 Jul
1973
08 Jul
1972
1971
---
08 Jul
1970
12
Jul
1969
06 Jul
1968
08 Jul
1967
09 Jul
1966
10
Jul
1965
Notes: 1965 was the inaugural year. The course was point-to-point,
from Inverness west to Forres. The 1970 course was about 3/4 mile (1200m)
short.
2:26:28
Alexander Keith (SCO)
2:22:29
Alastair Wood-6
2:33:00
Donald Ritchie (SCO)
not held
2:13:44
Alastair Wood-5
2:27:44
Alastair Wood-4
2:18:43
Joseph Clare (SCO)
2:16:16
Alastair Wood-3
2:13:45
Alastair Wood-2
2:29:54
Alastair Wood (SCO)
Most Wins (1965-1974)
Men
6
Alastair Wood (SCO)
1965-67,1969-70,1973
Prize Money
(ADR qualified runners)
No prize money was awarded at this race.
Race Time Bias
(sec/km)
Insufficient data to calculated the race time bias.
Competitive Level
(1990-date)
Insufficient data to calculated the competitive level.
Quality Performances
Men <2:14 1 <2:15 1 <2:16 1 <2:17 2 <2:18 2 <2:19 3 <2:20 3
Last Updated on 26 Dec 2015
Contributors: Colin Youngson (5), Mick McGeoch (2)


| Category: iterators | Component type: overview |
Iterators are central to generic programming because they are an interface between containers and algorithms: algorithms typically take iterators as arguments, so a container need only provide a way to access its elements using iterators. This makes it possible to write a generic algorithm that operates on many different kinds of containers, even containers as different as a vector and a doubly linked list.
The STL defines several different concepts related to iterators, several predefined iterators, and a collection of types and functions for manipulating iterators.
The most restricted sorts of iterators are Input Iterators and Output Iterators, both of which permit "single pass" algorithms but do not necessarily support "multi-pass" algorithms. Input iterators only guarantee read access: it is possible to dereference an Input Iterator to obtain the value it points to, but not it is not necessarily possible to assign a new value through an input iterator. Similarly, Output Iterators only guarantee write access: it is possible to assign a value through an Output Iterator, but not necessarily possible to refer to that value.
Forward Iterators are a refinement of Input Iterators and Output Iterators: they support the Input Iterator and Output Iterator operations and also provide additional functionality. In particular, it is possible to use "multi-pass" algorithms with Forward Iterators. A Forward Iterator may be constant, in which case it is possible to access the object it points to but not to to assign a new value through it, or mutable, in which case it is possible to do both.
Bidirectional Iterators, like Forward Iterators, allow multi-pass algorithms. As the name suggests, they are different in that they support motion in both directions: a Bidirectional Iterator may be incremented to obtain the next element or decremented to obtain the previous element. A Forward Iterator, by contrast, is only required to support forward motion. An iterator used to traverse a singly linked list, for example, would be a Forward Iterator, while an iterator used to traverse a doubly linked list would be a Bidirectional Iterator.
Finally, Random Access Iterators allow the operations of pointer arithmetic: addition of arbitrary offsets, subscripting, subtraction of one iterator from another to find a distance, and so on.
Most algorithms are expressed not in terms of a single iterator but in terms of a range of iterators [1]; the notation [first, last) refers to all of the iterators from first up to, but not including, last. [2] Note that a range may be empty, i.e. first and last may be the same iterator. Note also that if there are n iterators in a range, then the notation [first, last) represents n+1 positions. This is crucial: algorithms that operate on n things frequently require n+1 positions. Linear search, for example (find) must be able to return some value to indicate that the search was unsuccessful.
Sometimes it is important to be able to infer some properties of an iterator: the type of object that is returned when it is dereferenced, for example. There are two different mechanisms to support this sort of inferrence: an older mechanism called Iterator Tags, and a newer mechanism called iterator_traits [3].
[1] Ranges are not a well-defined concept for Trivial Iterators, because a Trivial Iterator cannot be incremented: there is no such thing as a next element. They are also not a well-defined concept for Output Iterators, because it is impossible to compare two Output Iterators for equality. Equality is crucial to the definition of a range, because only by comparing an iterator for equality with the last element is it possible to step through a range.
[2] Sometimes the notation [first, last) refers to the iterators first, first+1, ..., last-1 and sometimes it refers to the objects pointed to by those iterators: *first, *(first+1), ..., *(last-1). In most cases it will be obvious from context which of these is meant; where the distinction is important, the notation will be qualified explicitly as "range of iterators" or "range of objects".
[3] The iterator_traits class relies on a C++ feature known as partial specialization. Many of today's compilers don't implement the complete standard; in particular, many compilers do not support partial specialization. If your compiler does not support partial specialization, then you will not be able to use iterator_traits, and you will instead have to continue using the functions iterator_category, distance_type, and value_type.


Bachelor of Science, Telecommunications – Media and Communication Technologies, Specializing in Information Computing Technologies with a cognate in Business.
Michigan State University •
East Lansing, MIMay 2011
- Classroom experience includes Object Oriented programming with C++, Ruby on Rails, Python, Visual Basic .Net, ASP.Net, and PHP.


Web Programming Club of Youngjong Middle School
Improve your programming skills at NPM
CSS, HTML, React
PHP, Node.JS
개발 프로젝트 진행