This document discusses penalty functions, which convert constrained optimization problems into unconstrained problems by introducing penalties for violating constraints. It presents the example of minimizing f(x)=100/x subject to x≤5. Constraints are converted to quadratic penalty terms and added to the objective function. Small iterative steps and increasing the penalty severity r improves convergence to the minimum. Practice problems demonstrate implementing an iterative minimization method and applying penalty functions to additional examples.
SA is a global optimization technique.
It distinguishes between different local optima.
It is a memory less algorithm & the algorithm does not use any information gathered during the search.
SA is motivated by an analogy to annealing in solids.
& it is an iterative improvement algorithm.
Mathematical Optimisation - Fundamentals and ApplicationsGokul Alex
My Session on Mathematical Optimisation Fundamentals and Industry applications for the Academic Knowledge Refresher Program organised by Kerala Technology University and College of Engineering Trivandrum, Department of Interdisciplinary Studies.
SA is a global optimization technique.
It distinguishes between different local optima.
It is a memory less algorithm & the algorithm does not use any information gathered during the search.
SA is motivated by an analogy to annealing in solids.
& it is an iterative improvement algorithm.
Mathematical Optimisation - Fundamentals and ApplicationsGokul Alex
My Session on Mathematical Optimisation Fundamentals and Industry applications for the Academic Knowledge Refresher Program organised by Kerala Technology University and College of Engineering Trivandrum, Department of Interdisciplinary Studies.
This presentation provides an introduction to the Particle Swarm Optimization topic, it shows the PSO basic idea, PSO parameters, advantages, limitations and the related applications.
Slides were formed by referring to the text Machine Learning by Tom M Mitchelle (Mc Graw Hill, Indian Edition) and by referring to Video tutorials on NPTEL
Brief introduction of neural network including-
1. Fitting Tool
2. Clustering data with a self-organising map
3. Pattern Recognition Tool
4. Time Series Toolbox
This presentation provides an introduction to the Particle Swarm Optimization topic, it shows the PSO basic idea, PSO parameters, advantages, limitations and the related applications.
Slides were formed by referring to the text Machine Learning by Tom M Mitchelle (Mc Graw Hill, Indian Edition) and by referring to Video tutorials on NPTEL
Brief introduction of neural network including-
1. Fitting Tool
2. Clustering data with a self-organising map
3. Pattern Recognition Tool
4. Time Series Toolbox
Adjusting primitives for graph : SHORT REPORT / NOTESSubhajit Sahu
Graph algorithms, like PageRank Compressed Sparse Row (CSR) is an adjacency-list based graph representation that is
Multiply with different modes (map)
1. Performance of sequential execution based vs OpenMP based vector multiply.
2. Comparing various launch configs for CUDA based vector multiply.
Sum with different storage types (reduce)
1. Performance of vector element sum using float vs bfloat16 as the storage type.
Sum with different modes (reduce)
1. Performance of sequential execution based vs OpenMP based vector element sum.
2. Performance of memcpy vs in-place based CUDA based vector element sum.
3. Comparing various launch configs for CUDA based vector element sum (memcpy).
4. Comparing various launch configs for CUDA based vector element sum (in-place).
Sum with in-place strategies of CUDA mode (reduce)
1. Comparing various launch configs for CUDA based vector element sum (in-place).
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Data and AI
Round table discussion of vector databases, unstructured data, ai, big data, real-time, robots and Milvus.
A lively discussion with NJ Gen AI Meetup Lead, Prasad and Procure.FYI's Co-Found
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Data and AI
Discussion on Vector Databases, Unstructured Data and AI
https://www.meetup.com/unstructured-data-meetup-new-york/
This meetup is for people working in unstructured data. Speakers will come present about related topics such as vector databases, LLMs, and managing data at scale. The intended audience of this group includes roles like machine learning engineers, data scientists, data engineers, software engineers, and PMs.This meetup was formerly Milvus Meetup, and is sponsored by Zilliz maintainers of Milvus.
Data Centers - Striving Within A Narrow Range - Research Report - MCG - May 2...pchutichetpong
M Capital Group (“MCG”) expects to see demand and the changing evolution of supply, facilitated through institutional investment rotation out of offices and into work from home (“WFH”), while the ever-expanding need for data storage as global internet usage expands, with experts predicting 5.3 billion users by 2023. These market factors will be underpinned by technological changes, such as progressing cloud services and edge sites, allowing the industry to see strong expected annual growth of 13% over the next 4 years.
Whilst competitive headwinds remain, represented through the recent second bankruptcy filing of Sungard, which blames “COVID-19 and other macroeconomic trends including delayed customer spending decisions, insourcing and reductions in IT spending, energy inflation and reduction in demand for certain services”, the industry has seen key adjustments, where MCG believes that engineering cost management and technological innovation will be paramount to success.
MCG reports that the more favorable market conditions expected over the next few years, helped by the winding down of pandemic restrictions and a hybrid working environment will be driving market momentum forward. The continuous injection of capital by alternative investment firms, as well as the growing infrastructural investment from cloud service providers and social media companies, whose revenues are expected to grow over 3.6x larger by value in 2026, will likely help propel center provision and innovation. These factors paint a promising picture for the industry players that offset rising input costs and adapt to new technologies.
According to M Capital Group: “Specifically, the long-term cost-saving opportunities available from the rise of remote managing will likely aid value growth for the industry. Through margin optimization and further availability of capital for reinvestment, strong players will maintain their competitive foothold, while weaker players exit the market to balance supply and demand.”
Levelwise PageRank with Loop-Based Dead End Handling Strategy : SHORT REPORT ...Subhajit Sahu
Abstract — Levelwise PageRank is an alternative method of PageRank computation which decomposes the input graph into a directed acyclic block-graph of strongly connected components, and processes them in topological order, one level at a time. This enables calculation for ranks in a distributed fashion without per-iteration communication, unlike the standard method where all vertices are processed in each iteration. It however comes with a precondition of the absence of dead ends in the input graph. Here, the native non-distributed performance of Levelwise PageRank was compared against Monolithic PageRank on a CPU as well as a GPU. To ensure a fair comparison, Monolithic PageRank was also performed on a graph where vertices were split by components. Results indicate that Levelwise PageRank is about as fast as Monolithic PageRank on the CPU, but quite a bit slower on the GPU. Slowdown on the GPU is likely caused by a large submission of small workloads, and expected to be non-issue when the computation is performed on massive graphs.
2. The Premise
You may have noticed that the addition of
constraints to an optimization problem has the
effect of making it much more difficult.
The goal of penalty functions is to convert
constrained problems into unconstrained
problems by introducing an artificial penalty for
violating the constraint.
3. The Premise
Consider this example: Suppose there is a freeway
(like a toll freeway) that monitors when you enter
and exit the road.
Instead of establishing a speed limit of 65 mph,
they could use these rules:
• You can drive as fast as you want.
• If you drive under 65 mph you can use our road
for free.
• Every mph you drive over 65 will cost you $500.
4. The Premise
The previous example had no constraints – you
can drive as fast as you want! But the effect of
these rules would still be to limit drivers to
65mph. You can also control the likelihood of
speeding by adjusting the fine.
Penalty functions work in exactly this way.
5. Initial Steps
We will be working with a very simple example:
minimize f(x) = 100/x
subject to x ≤ 5
(With a little thought, you can tell that f(x) will be minimized
when x = 5, so we know what answer we should get!)
Before starting, convert any constraints into the
form (expression) ≤ 0. In this example, x ≤ 5
becomes:
x – 5 ≤ 0
6. Initial Steps
Once your constraints are converted, the next
step is to start charging a penalty for violating
them. Since we’re trying to minimize f(x), this
means we need to add value when the
constraint is violated.
If you are trying to maximize, the penalty will
subtract value.
7. Quadratic Loss: Inequalities
With the constraint x – 5 ≤ 0, we need a penalty that is:
• 0 when x – 5 ≤ 0 (the constraint is satisfied)
• positive when x – 5 is > 0 (the constraint is violated)
This can be done using the operation
P(x) = max(0, x – 5)
which returns the maximum of the two values, either 0
or whatever (x – 5) is.
We can make the penalty more severe by using
P(x) = max(0, x – 5)2.
This is known as a quadratic loss function.
8. Quadratic Loss: Equalities
It is even easier to convert equality constraints
into quadratic loss functions because we don’t
need to worry about the operation (max, g(x)).
We can convert h(x) = c into h(x) – c = 0, then
use
P(x) = (h(x) – c)2
The lowest value of P(x) will occur when h(x) = c,
in which case the penalty P(x) = 0. This is exactly
what we want.
9. Practice Problem 1
Convert the following constraints into quadratic
loss functions:
a) x ≤ 12
b) x2 ≥ 200
c) 2x + 7 ≤ 16
d) e2x + 1 ≥ 9
e) 4x2 + 2x = 12
10. The Next Step
Once you have converted your constraints into
penalty functions, the basic idea is to add all the
penalty functions on to the original objective
function and minimize from there:
minimize T(x) = f(x) + P(x)
In our example,
minimize T(x) = 100/x + max(0, x – 5)2
11. A Problem
But… it isn’t quite that easy.
The addition of penalty functions can create severe
slope changes in the graph at the boundary, which
interferes with typical minimization programs.
Fortunately, there are two simple changes that will
alleviate this problem.
12. First Solution: r
The first is to multiply the quadratic loss function by
a constant, r. This controls how severe the penalty
is for violating the constraint.
The accepted method is to start with r =
10, which is a mild penalty. It will not form
a very sharp point in the graph, but the
minimum point found using r = 10 will not
be a very accurate answer because the
penalty is not severe enough.
13. First Solution: r
Then, r is increased to 100 and the
function minimized again starting from the
minimum point found when r was 10. The
higher penalty increases accuracy, and as
we narrow in on the solution, the
sharpness of the graph is less of a
problem.
We continue to increase r values until the
solutions converge.
14. Second Solution: Methods
The second solution is to be thoughtful with
how we minimize. The more useful minimization
programs written in unit 2 were interval
methods. The program started with an interval
and narrowed it in from the endpoints.
With a severe nonlinearity, interval methods
have a tendency to skip right over the minimum.
15. Second Solution: Methods
For this reason, interval methods are generally
not ideal for penalty functions. It is better to use
methods that take tiny steps from a starting
point, similar to the “brute force” methods we
used in 1-variable, or any of the methods we
used in 2-variable minimization.
It is also important when using penalty functions
to run the program a few times from various
starting points to avoid local extremes.
16. Practice Problem 2
Write a program that, given an initial point and a
function,
1) uses the derivative to determine the
direction of the minimum
2) takes small steps in that direction until the
function value increases
3) decreases the step size to narrow in on the
minimum
4) reports the minimum value
Test, document and save your code!
17. The Final Step
Now, back to the example:
minimize f(x) = 100/x
subject to x ≤ 5
has become
minimize T(x) = 100/x + r · (max(0, x – 5)2)
The initial point must be chosen in violation of the
constraint, which is why these are known as
“exterior penalty functions”. We’ll start with x = 20.
18. Practice Problem 3
Using your step minimization program, minimize
f(x) = 100/x + 10 · (max(0, x – 5))2
from starting point 20. Call your answer “a”.
Then, minimize
f(x) = 100/x + 100 · (max(0, x – 5))2
from starting point a.
Repeat for r = 1000 and r = 10,000.
19. Practice Problem 4
Write a function that will carry out successive
iterations of raising the value of r and closing
the interval boundaries. Check your loop with
the previous problem, then use it to solve this
problem:
minimize f(x) = 0.8x2 – 2x
subject to x ≤ 4
Test different starting points to see the effect.
20. Practice Problem 5
Next, solve this problem:
Minimize f(x) = (x – 8)2
subject to x ≥ 10
(Be careful with that ≥! it will affect both your g(x) and
your starting point.)
21. A Note About Exterior Penalty
Functions
Because exterior penalty functions start outside
the feasible region and approach it from the
outside, they only find extremes that occur on
the boundaries of the feasible region. They will
not find interior extremes.
In order to accomplish that, these are often
used in combination with interior penalty
functions… next lesson!