diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..b746e86 --- /dev/null +++ b/LICENSE @@ -0,0 +1,60 @@ +""" +LICENSE TYPE: MIT + +Received: from [192.168.2.2] (adsl-76-254-50-95.dsl.pltn13.sbcglobal.net [76.254.50.95]) + (Authenticated sender: jared@skej.us) + by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id D9F06FB883 + for ; Sun, 2 Nov 2014 08:05:18 +0100 (CET) +From: Jared Flatow +Content-Type: multipart/alternative; boundary="Apple-Mail=_A174274C-E60A-4BEC-B9E6-8EAACA36F10A" +Message-Id: <7AC2783C-4844-4C47-B724-47E6C8DEE4F9@gmail.com> +Mime-Version: 1.0 (Mac OS X Mail 6.6 \(1510\)) +Subject: Re: I just cloned your github library phd.git +Date: Sun, 2 Nov 2014 00:05:15 -0700 +References: +To: George Lambert +In-Reply-To: +X-Mailer: Apple Mail (2.1510) + + +--Apple-Mail=_A174274C-E60A-4BEC-B9E6-8EAACA36F10A +Content-Transfer-Encoding: quoted-printable +Content-Type: text/plain; + charset=windows-1252 + +Yes I hereby grant you such a license :) Thanks for asking first. + +I look forward to seeing what you do with it! I never used it for = +anything practical. I should probably continue with the extending to = +higher dimensions at some point, Dr. Wildberger confirmed that I was = +going in the right direction=85 + +best, +jared + +""" +_License = 'MIT' + +""" +The MIT License + +Copyright (c) Jared Flatow 2014 http://www.flatown.com + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +""" diff --git a/concrete_mathematics/binomials.py b/concrete_mathematics/binomials.py index e1f88fb..1d759f1 100644 --- a/concrete_mathematics/binomials.py +++ b/concrete_mathematics/binomials.py @@ -1,3 +1,29 @@ +""" +The MIT License + +Copyright (c) Jared Flatow 2014 http://www.flatown.com + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +""" + + + from itertools import count, islice from math import factorial from sums import rising diff --git a/concrete_mathematics/integers.py b/concrete_mathematics/integers.py index 9c14252..fc336ce 100644 --- a/concrete_mathematics/integers.py +++ b/concrete_mathematics/integers.py @@ -1,3 +1,30 @@ +""" +The MIT License + +Copyright (c) Jared Flatow 2014 http://www.flatown.com + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +""" + + + + from math import ceil, floor def nth_root(N, n=3): diff --git a/concrete_mathematics/numbertheory.py b/concrete_mathematics/numbertheory.py index 73075e3..37bd7cf 100644 --- a/concrete_mathematics/numbertheory.py +++ b/concrete_mathematics/numbertheory.py @@ -1,3 +1,29 @@ +""" +The MIT License + +Copyright (c) Jared Flatow 2014 http://www.flatown.com + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +""" + + + def gcd(m, n): if not m: return n diff --git a/concrete_mathematics/recurrence.py b/concrete_mathematics/recurrence.py index f8fe952..abcfae3 100644 --- a/concrete_mathematics/recurrence.py +++ b/concrete_mathematics/recurrence.py @@ -1,3 +1,29 @@ +""" +The MIT License + +Copyright (c) Jared Flatow 2014 http://www.flatown.com + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +""" + + + def hanoi(n): return 2 ** n - 1 @@ -18,4 +44,3 @@ def f(n, alpha=1, beta=-1, gamma=1): if n <= 1: return alpha return 2 * f(n / 2) + (gamma if n % 2 else beta) - diff --git a/concrete_mathematics/sums.py b/concrete_mathematics/sums.py index a5f66d9..6550d4f 100644 --- a/concrete_mathematics/sums.py +++ b/concrete_mathematics/sums.py @@ -1,3 +1,28 @@ +""" +The MIT License + +Copyright (c) Jared Flatow 2014 http://www.flatown.com + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +""" + + from operator import mul from fractions import Fraction @@ -16,4 +41,3 @@ def rising(x, m): if m < 0: return Fraction(1, rising(x + m, -m)) return reduce(mul, xrange(x, x + m), 1) - diff --git a/convex_optimization/admm.py b/convex_optimization/admm.py index 2c69861..bd6e029 100644 --- a/convex_optimization/admm.py +++ b/convex_optimization/admm.py @@ -1,3 +1,29 @@ +""" +The MIT License + +Copyright (c) Jared Flatow 2014 http://www.flatown.com + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +""" + + + """ This module implements some of the ideas from the paper: diff --git a/convex_optimization/distributed_logistic_regression.py b/convex_optimization/distributed_logistic_regression.py index f9901ca..6952080 100644 --- a/convex_optimization/distributed_logistic_regression.py +++ b/convex_optimization/distributed_logistic_regression.py @@ -1,3 +1,27 @@ +""" +The MIT License + +Copyright (c) Jared Flatow 2014 http://www.flatown.com + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +""" + from disco.core import Job, Params, RecordIter class LogisticRegress(Job): @@ -22,5 +46,3 @@ def reduce(iter, params): job = LogisticRegress(params=params) results = job.wait() for i, (x, y) in RecordIter(job.wait()): - - diff --git a/convex_optimization/logs.py b/convex_optimization/logs.py index 27486f2..2f13b09 100644 --- a/convex_optimization/logs.py +++ b/convex_optimization/logs.py @@ -1,3 +1,30 @@ +""" +The MIT License + +Copyright (c) Jared Flatow 2014 http://www.flatown.com + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +""" + + + + def strval(string): return sum(ord(c) * 10**-n for n, c in enumerate(string.lower())) diff --git a/convex_optimization/theory.py b/convex_optimization/theory.py index 54ec340..9dc63e6 100644 --- a/convex_optimization/theory.py +++ b/convex_optimization/theory.py @@ -1,3 +1,31 @@ +""" +The MIT License + +Copyright (c) Jared Flatow 2014 http://www.flatown.com + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +""" + + + + + """ An attempt to codify the relationships between the mathematical objects defined in cvxbook. diff --git a/dynamic_programming/allocation.py b/dynamic_programming/allocation.py index 4a49fc8..56d72a2 100644 --- a/dynamic_programming/allocation.py +++ b/dynamic_programming/allocation.py @@ -1,3 +1,29 @@ +""" +The MIT License + +Copyright (c) Jared Flatow 2014 http://www.flatown.com + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +""" + + + class Allocator(object): def __init__(self, a, b, g, h): diff --git a/geometry/hyperbolic-geo.pdf b/geometry/hyperbolic-geo.pdf new file mode 100644 index 0000000..e7096d9 Binary files /dev/null and b/geometry/hyperbolic-geo.pdf differ diff --git a/geometry/hyperbolic.py b/geometry/hyperbolic.py index 5732392..c2addf0 100644 --- a/geometry/hyperbolic.py +++ b/geometry/hyperbolic.py @@ -1,3 +1,65 @@ +""" +LICENSE TYPE: MIT + +Received: from [192.168.2.2] (adsl-76-254-50-95.dsl.pltn13.sbcglobal.net [76.254.50.95]) + (Authenticated sender: jared@skej.us) + by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id D9F06FB883 + for ; Sun, 2 Nov 2014 08:05:18 +0100 (CET) +From: Jared Flatow +Content-Type: multipart/alternative; boundary="Apple-Mail=_A174274C-E60A-4BEC-B9E6-8EAACA36F10A" +Message-Id: <7AC2783C-4844-4C47-B724-47E6C8DEE4F9@gmail.com> +Mime-Version: 1.0 (Mac OS X Mail 6.6 \(1510\)) +Subject: Re: I just cloned your github library phd.git +Date: Sun, 2 Nov 2014 00:05:15 -0700 +References: +To: George Lambert +In-Reply-To: +X-Mailer: Apple Mail (2.1510) + + +--Apple-Mail=_A174274C-E60A-4BEC-B9E6-8EAACA36F10A +Content-Transfer-Encoding: quoted-printable +Content-Type: text/plain; + charset=windows-1252 + +Yes I hereby grant you such a license :) Thanks for asking first. + +I look forward to seeing what you do with it! I never used it for = +anything practical. I should probably continue with the extending to = +higher dimensions at some point, Dr. Wildberger confirmed that I was = +going in the right direction=85 + +best, +jared + +""" +_License = 'MIT' + +""" +The MIT License + +Copyright (c) Jared Flatow 2014 http://www.flatown.com + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +""" + + """ Some rational universal hyperbolic geometry as per the inimitable Norman J. Wildberger. diff --git a/lambda_calculus/combinator.erl b/lambda_calculus/combinator.erl index fafc29c..5b26e8c 100644 --- a/lambda_calculus/combinator.erl +++ b/lambda_calculus/combinator.erl @@ -1,3 +1,31 @@ +""" +The MIT License + +Copyright (c) Jared Flatow 2014 http://www.flatown.com + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +""" + + + + + -module(combinator). -export([factorial/1, x/1, y/1, z/1]). diff --git a/machine_learning/neural.py b/machine_learning/neural.py index b343529..3981c8d 100644 --- a/machine_learning/neural.py +++ b/machine_learning/neural.py @@ -1,3 +1,29 @@ +""" +The MIT License + +Copyright (c) Jared Flatow 2014 http://www.flatown.com + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +""" + + + from math import tanh from random import random diff --git a/machine_learning/regression.py b/machine_learning/regression.py index e976d56..faca549 100644 --- a/machine_learning/regression.py +++ b/machine_learning/regression.py @@ -1,3 +1,29 @@ +""" +The MIT License + +Copyright (c) Jared Flatow 2014 http://www.flatown.com + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +""" + + + from math import exp from numpy import array, ones, zeros diff --git a/misc/bezier.py b/misc/bezier.py index d69e50a..b70497a 100644 --- a/misc/bezier.py +++ b/misc/bezier.py @@ -1,3 +1,29 @@ +""" +The MIT License + +Copyright (c) Jared Flatow 2014 http://www.flatown.com + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +""" + + + """ Converting Quadratic Polynomials to Quadratic Bezier Curves =========================================================== diff --git a/misc/derivatives.py b/misc/derivatives.py index 0afd818..6f0d173 100644 --- a/misc/derivatives.py +++ b/misc/derivatives.py @@ -1,3 +1,28 @@ +""" +The MIT License + +Copyright (c) Jared Flatow 2014 http://www.flatown.com + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +""" + + def args(f): return f.__code__.co_varnames @@ -54,4 +79,3 @@ def hessian(y): def jacobian(Y): return [gradient(y) for y in Y] - diff --git a/stochastic_control/bellman.py b/stochastic_control/bellman.py index 7b83acd..bf74e5d 100644 --- a/stochastic_control/bellman.py +++ b/stochastic_control/bellman.py @@ -1,3 +1,30 @@ +""" +The MIT License + +Copyright (c) Jared Flatow 2014 http://www.flatown.com + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +""" + + + + """ Another approach to dynamic programming. diff --git a/stochastic_control/decision.py b/stochastic_control/decision.py index efd225f..57b5eaf 100644 --- a/stochastic_control/decision.py +++ b/stochastic_control/decision.py @@ -1,3 +1,30 @@ +""" +The MIT License + +Copyright (c) Jared Flatow 2014 http://www.flatown.com + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +""" + + + + """ Bellman equations for random variables (Markov Decision Problems) diff --git a/stochastic_control/markov.py b/stochastic_control/markov.py index 955e5e4..8907ab5 100644 --- a/stochastic_control/markov.py +++ b/stochastic_control/markov.py @@ -1,3 +1,30 @@ +""" +The MIT License + +Copyright (c) Jared Flatow 2014 http://www.flatown.com + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +""" + + + + """ Some Markov ideas. diff --git a/stochastic_control/query.py b/stochastic_control/query.py index a6ba7a7..d98b394 100644 --- a/stochastic_control/query.py +++ b/stochastic_control/query.py @@ -1,3 +1,30 @@ +""" +The MIT License + +Copyright (c) Jared Flatow 2014 http://www.flatown.com + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +""" + + + + """ Active query example from: http://www.stanford.edu/class/ee365/lectures/active_query.pdf """ diff --git a/stochastic_control/trading.py b/stochastic_control/trading.py index 50a4375..d9656df 100644 --- a/stochastic_control/trading.py +++ b/stochastic_control/trading.py @@ -1,3 +1,32 @@ +""" +The MIT License + +Copyright (c) Jared Flatow 2014 http://www.flatown.com + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +""" + + + + + + """ Trading example from: http://www.stanford.edu/class/ee365/lectures/trading.pdf """