Gradient Error and Origami My Work With The Space Time Programming - - PowerPoint PPT Presentation

gradient error and origami
SMART_READER_LITE
LIVE PREVIEW

Gradient Error and Origami My Work With The Space Time Programming - - PowerPoint PPT Presentation

Gradient Error and Origami My Work With The Space Time Programming Group Josh Horowitz MIT CSAIL November 2, 2007 Josh Horowitz (MIT CSAIL) Gradient Error and Origami November 2, 2007 1 / 18 UROP Proposal Two branches of research: 1


slide-1
SLIDE 1

Gradient Error and Origami

My Work With The Space Time Programming Group Josh Horowitz

MIT CSAIL

November 2, 2007

Josh Horowitz (MIT CSAIL) Gradient Error and Origami November 2, 2007 1 / 18

slide-2
SLIDE 2

UROP Proposal

Two branches of research:

1 Analyze errors of gradients.

‘. . . I will investigate error in the ubiquitous “gradient” algorithm, which determines the distance from a processor to a designated region. My investigation will involve both conceptual analysis of mathematical models and quantitative analysis of computer-run simulations.’

2 Make Proto fold.

‘. . . I will also pursue the project of implementing Radhika Nagpal’s biologically-inspired Origami Shape Language in the STPG’s Proto programming language.’

Josh Horowitz (MIT CSAIL) Gradient Error and Origami November 2, 2007 2 / 18

slide-3
SLIDE 3

Gradients

The Algorithm

The gradient algorithm gives a way to estimate global distance (across many radio ranges) from local distance.

1 Initialize the source S at 0 and all other nodes at ∞. 2 Continually update the gradient value of all nodes N /

∈ S based on their neighbors in order to keep the triangle inequality maintained: Gradient(N) = min

N′ near N

  • Gradient(N′) + d(N, N ′)
  • .

Essentially, this gives the length of the shortest path from N to the source in a graph with edges connecting nearby nodes.

Josh Horowitz (MIT CSAIL) Gradient Error and Origami November 2, 2007 3 / 18

slide-4
SLIDE 4

Gradients

The Problem

Even with error-free processing and error-free local range-finding, the gradient algorithm is not error-free: trails are jagged.

Figure: Gradient trails back to a source.

Josh Horowitz (MIT CSAIL) Gradient Error and Origami November 2, 2007 4 / 18

slide-5
SLIDE 5

Gradients

This jaggedness introduces both systematic and statistical error into the gradient algorithm. I studied one particular kind of systematic error, the fact that the gradient algorithm more accurately measures αd(N, S) than d(N, S) itself (for some constant α 1). That is, there is an underlying jaggedness that asymptotically causes gradient values to be scaled upwards by a constant factor α.

5 10 15 20 0.2 0.4 0.6 0.8 1.0

Figure: d(N, S) vs. [GradientS(N) − d(N, S)] (so the red line has slope α − 1)

Josh Horowitz (MIT CSAIL) Gradient Error and Origami November 2, 2007 5 / 18

slide-6
SLIDE 6

Gradients

There are different ways of looking at this phenomena:

It is unfortunate error which we would like to avoid. We need to know how high node density (Nloc) has to be to put α close enough to 1 for

  • ur purposes, whatever they may be.

More reasonably: It is a feature of how the gradient algorithm works which we would like to correct for. We need to know what α is in terms of Nloc.

Either way requires knowing the relationship between Nloc and α. I first investigated this question through direct experimentation.

Josh Horowitz (MIT CSAIL) Gradient Error and Origami November 2, 2007 6 / 18

slide-7
SLIDE 7

Gradients Experiments

Basic Setup

Fill a rectangle randomly with nodes. Set a thin strip along the left edge to be the source. Run a gradient. The output of a run will be a set of pairs (d(N, S), GradientS(N)) = (actual distance, calculated distance). We perform a linear regression to determine the value of α for this particular run. After many runs, with varying Nloc, we will have a large set of (Nloc, α)s to analyze.

6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 nloc 1.02 1.04 1.06 1.08 1.10 1.12 1.14 Α 7 8 9 10 11 12 13 14 15 16 17 18192021222324 nloc 0.010 0.100 0.050 0.020 0.200 0.030 0.300 0.015 0.150 0.070 Α 1

Figure: Nloc vs. α (linear and log-log).

Josh Horowitz (MIT CSAIL) Gradient Error and Origami November 2, 2007 7 / 18

slide-8
SLIDE 8

Gradients Experiments

Initial Results

When I gave my first presentation on my research, things seemed to be pointing nicely to a α ∝ n

−2 loc

  • relationship. The two experiments

represented below gave fits α = 0.693n

−2.212 loc

and α = 0.648n

−2.045 loc

, respectively.

Figure: Old-school data.

Josh Horowitz (MIT CSAIL) Gradient Error and Origami November 2, 2007 8 / 18

slide-9
SLIDE 9

Gradients Experiments

Condor

To continue exploring the parameter space effectively, I developed a system to run Proto simulations on CSAIL’s Condor-based computing

  • cluster. This required:

Stripping Proto of its graphics code, so it can compile and run on the cluster. Figuring out how to make Condor play nice with output of dump files. Making scripts to generate large “submit” files for Condor.

Josh Horowitz (MIT CSAIL) Gradient Error and Origami November 2, 2007 9 / 18

slide-10
SLIDE 10

Gradients Experiments

Newer Results

With the computing cluster, I could run Proto thousands and thousands of times with thousands of nodes per run. The results threw doubt on the simplicity of a -2 exponent: Each point is a run: they are partitioned into four experiments (red, blue, green, and purple). The dark black line is the fit, α = 22.91 · n

−2.608 loc

. The pale line is the fit from the old set of experiments.

8 10 12 14 16 18 20 22 24 0.010 0.100 0.050 0.020 0.200 0.030 0.300 0.015 0.150 0.070

Josh Horowitz (MIT CSAIL) Gradient Error and Origami November 2, 2007 10 / 18

slide-11
SLIDE 11

Gradients Theory

I took a break from running experiments and analyzing data to see if I could derive an expression for α purely from theory.

Josh Horowitz (MIT CSAIL) Gradient Error and Origami November 2, 2007 11 / 18

slide-12
SLIDE 12

Gradients Theory

Theoretical Model

Consider a node N at (0, 0), with the gradient source infinitely far to the right (positive x direction). If N uses some neighboring node N1 located at (x, y) in its gradient path to the source, it will move us x closer to the source, while increasing the gradient value by

  • x2 + y2.

If this pattern continues, we will have α = √

x2+y2 x

=

  • 1 +

y

x

2. Assuming N1 is distributed uniformly in the half-circle to N’s right, a simple geometric argument yields the cumulative distribution F(A) = P(α < A) = 2

π arctan

√ A2 − 1. Taking the derivative of this yields the probability density function f(α) = 2

π 1 α √ α2−1.

Josh Horowitz (MIT CSAIL) Gradient Error and Origami November 2, 2007 12 / 18

slide-13
SLIDE 13

Gradients Theory

Now suppose N has exactly Nloc/2 = n neighbors to its right. Each gives rise to an α with an identical distribution to that just derived (That is, we suppose that we have Nloc/2 independent and identically distributed random variables). To calculate the distribution

  • f their minimum, we use the order-statistic formula:

fmin(α) = n(1 − F(α))n−1f(α) = n 2 π n (arccot α)n−1 α √ α2 − 1 .

1.2 1.4 1.6 1.8 2.0 Α 0.5 1.0 1.5 2.0

Figure: Plots of fmin(α) for n = 1, 2, 3, 4, 5 (higher n = ⇒ lower fmin as α → ∞).

Josh Horowitz (MIT CSAIL) Gradient Error and Origami November 2, 2007 13 / 18

slide-14
SLIDE 14

Gradients Theory

The expected values of these distributions are E(αmin) = n 2 π n π/2 βn−1 csc β dβ. Mathematica can’t touch these, but we can analyze them numerically.

50 100 150 200 Nloc 0.002 0.004 0.006 0.008 0.010 0.012 Α 1 2 5 10 20 50 100 200 Nloc 0.001 0.01 0.1 1 Α 1

Figure: nloc vs. α (linear and log-log).

The fit line plotted in the second graph is α = 6.476n

−1.922 loc

.

Josh Horowitz (MIT CSAIL) Gradient Error and Origami November 2, 2007 14 / 18

slide-15
SLIDE 15

Gradients Theory

Theory vs. Experiment

Predicting an exponent of -2 used to sound good, but more thorough experimentation seems to suggest that it is innacurate.

8 10 12 14 16 18 20 22 24 0.010 0.100 0.050 0.020 0.200 0.030 0.300 0.015 0.150 0.070

Figure: nloc vs. α (red line is the prediction from theory).

Josh Horowitz (MIT CSAIL) Gradient Error and Origami November 2, 2007 15 / 18

slide-16
SLIDE 16

Gradients Theory

Theoretical Model

Where does this discrepancy come from? Assumptions

1 The source is very far away. 2 There is no variation in the number of neighbors. 3 The distribution of neighbors of any two nodes is independent (even

for nodes with overlapping neighborhoods). None of these holds exactly during the execution of a gradient. It is unknown whether their failures invalidate the results completely, introduce additional phenomena to augment the results with, or are completely negligible.

Josh Horowitz (MIT CSAIL) Gradient Error and Origami November 2, 2007 16 / 18

slide-17
SLIDE 17

Origami

Origami with Proto

In her PhD thesis, Radhika Nagpal describes a foldable sheet of cells which, purely through local interaction and actuation, can attain a shape determined by a global specification. My other goal for the summer was to implement this in Proto. This consisted of several tasks:

1

Implement a folding mechanism in the Proto simulator and add language hooks to access the new features (actuators and sensors).

2

Figure out how to determine creases and sequence folds in Proto code.

3

Write a program to transform a specification written in Nagpal’s high-level Origami Shape Language into a Proto program which folds the material as specified.

I finished the first two of these to some degree. Unfortunately, I can’t get it to run right now. :-(

Josh Horowitz (MIT CSAIL) Gradient Error and Origami November 2, 2007 17 / 18

slide-18
SLIDE 18

Conclusion

Conclusion

I hope that my work has been of value (perhaps I should finish it off and write it up to make sure. . . ). Especially looking back, it is clear that there are many interesting questions left to explore. This summer was one of the best in my life. Thanks to everyone I worked with for their help, encouragement, and patience.

Josh Horowitz (MIT CSAIL) Gradient Error and Origami November 2, 2007 18 / 18