Classes |
| class | Test::Int::Arithmetic::MultXYZ |
| | Test for multiplication constraint More...
|
| class | Test::Int::Arithmetic::MultXXY |
| | Test for multiplication constraint with shared variables More...
|
| class | Test::Int::Arithmetic::MultXYX |
| | Test for multiplication constraint with shared variables More...
|
| class | Test::Int::Arithmetic::MultXYY |
| | Test for multiplication constraint with shared variables More...
|
| class | Test::Int::Arithmetic::MultXXX |
| | Test for multiplication constraint with shared variables More...
|
| class | Test::Int::Arithmetic::SqrXY |
| | Test for squaring constraint More...
|
| class | Test::Int::Arithmetic::SqrXX |
| | Test for squaring constraint with shared variables More...
|
| class | Test::Int::Arithmetic::SqrtXY |
| | Test for square root constraint More...
|
| class | Test::Int::Arithmetic::SqrtXX |
| | Test for square root constraint with shared variables More...
|
| class | Test::Int::Arithmetic::DivMod |
| | Test for division/modulo constraint More...
|
| class | Test::Int::Arithmetic::Div |
| | Test for division constraint More...
|
| class | Test::Int::Arithmetic::Mod |
| | Test for modulo constraint More...
|
| class | Test::Int::Arithmetic::AbsXY |
| | Test for absolute value constraint More...
|
| class | Test::Int::Arithmetic::AbsXX |
| | Test for absolute value constraint with shared variables More...
|
| class | Test::Int::Arithmetic::MinXYZ |
| | Test for binary minimum constraint More...
|
| class | Test::Int::Arithmetic::MinXXY |
| | Test for binary minimum constraint with shared variables More...
|
| class | Test::Int::Arithmetic::MinXYX |
| | Test for binary minimum constraint with shared variables More...
|
| class | Test::Int::Arithmetic::MinXYY |
| | Test for binary minimum constraint with shared variables More...
|
| class | Test::Int::Arithmetic::MinXXX |
| | Test for binary minimum constraint with shared variables More...
|
| class | Test::Int::Arithmetic::MaxXYZ |
| | Test for binary maximum constraint More...
|
| class | Test::Int::Arithmetic::MaxXXY |
| | Test for binary maximum constraint with shared variables More...
|
| class | Test::Int::Arithmetic::MaxXYX |
| | Test for binary maximum constraint with shared variables More...
|
| class | Test::Int::Arithmetic::MaxXYY |
| | Test for binary maximum constraint with shared variables More...
|
| class | Test::Int::Arithmetic::MaxXXX |
| | Test for binary maximum constraint with shared variables More...
|
| class | Test::Int::Arithmetic::MinNary |
| | Test for n-ary minimmum constraint More...
|
| class | Test::Int::Arithmetic::MinNaryShared |
| | Test for n-ary minimmum constraint with shared variables More...
|
| class | Test::Int::Arithmetic::MaxNary |
| | Test for n-ary maximum constraint More...
|
| class | Test::Int::Arithmetic::MaxNaryShared |
| | Test for n-ary maximum constraint with shared variables More...
|
Variables |
| const int | Test::Int::Arithmetic::va [7] |
| const int | Test::Int::Arithmetic::vb [9] |
| Gecode::IntSet | Test::Int::Arithmetic::a (va, 7) |
| Gecode::IntSet | Test::Int::Arithmetic::b (vb, 9) |
| Gecode::IntSet | Test::Int::Arithmetic::c (-8, 8) |
| MultXYZ | Test::Int::Arithmetic::mult_xyz_b_a ("A", a, Gecode::ICL_BND) |
| MultXYZ | Test::Int::Arithmetic::mult_xyz_b_b ("B", b, Gecode::ICL_BND) |
| MultXYZ | Test::Int::Arithmetic::mult_xyz_b_c ("C", c, Gecode::ICL_BND) |
| MultXXY | Test::Int::Arithmetic::mult_xxy_b_a ("A", a, Gecode::ICL_BND) |
| MultXXY | Test::Int::Arithmetic::mult_xxy_b_b ("B", b, Gecode::ICL_BND) |
| MultXXY | Test::Int::Arithmetic::mult_xxy_b_c ("C", c, Gecode::ICL_BND) |
| MultXYX | Test::Int::Arithmetic::mult_xyx_b_a ("A", a, Gecode::ICL_BND) |
| MultXYX | Test::Int::Arithmetic::mult_xyx_b_b ("B", b, Gecode::ICL_BND) |
| MultXYX | Test::Int::Arithmetic::mult_xyx_b_c ("C", c, Gecode::ICL_BND) |
| MultXYY | Test::Int::Arithmetic::mult_xyy_b_a ("A", a, Gecode::ICL_BND) |
| MultXYY | Test::Int::Arithmetic::mult_xyy_b_b ("B", b, Gecode::ICL_BND) |
| MultXYY | Test::Int::Arithmetic::mult_xyy_b_c ("C", c, Gecode::ICL_BND) |
| MultXXX | Test::Int::Arithmetic::mult_xxx_b_a ("A", a, Gecode::ICL_BND) |
| MultXXX | Test::Int::Arithmetic::mult_xxx_b_b ("B", b, Gecode::ICL_BND) |
| MultXXX | Test::Int::Arithmetic::mult_xxx_b_c ("C", c, Gecode::ICL_BND) |
| MultXYZ | Test::Int::Arithmetic::mult_xyz_d_a ("A", a, Gecode::ICL_DOM) |
| MultXYZ | Test::Int::Arithmetic::mult_xyz_d_b ("B", b, Gecode::ICL_DOM) |
| MultXYZ | Test::Int::Arithmetic::mult_xyz_d_c ("C", c, Gecode::ICL_DOM) |
| MultXXY | Test::Int::Arithmetic::mult_xxy_d_a ("A", a, Gecode::ICL_DOM) |
| MultXXY | Test::Int::Arithmetic::mult_xxy_d_b ("B", b, Gecode::ICL_DOM) |
| MultXXY | Test::Int::Arithmetic::mult_xxy_d_c ("C", c, Gecode::ICL_DOM) |
| MultXYX | Test::Int::Arithmetic::mult_xyx_d_a ("A", a, Gecode::ICL_DOM) |
| MultXYX | Test::Int::Arithmetic::mult_xyx_d_b ("B", b, Gecode::ICL_DOM) |
| MultXYX | Test::Int::Arithmetic::mult_xyx_d_c ("C", c, Gecode::ICL_DOM) |
| MultXYY | Test::Int::Arithmetic::mult_xyy_d_a ("A", a, Gecode::ICL_DOM) |
| MultXYY | Test::Int::Arithmetic::mult_xyy_d_b ("B", b, Gecode::ICL_DOM) |
| MultXYY | Test::Int::Arithmetic::mult_xyy_d_c ("C", c, Gecode::ICL_DOM) |
| MultXXX | Test::Int::Arithmetic::mult_xxx_d_a ("A", a, Gecode::ICL_DOM) |
| MultXXX | Test::Int::Arithmetic::mult_xxx_d_b ("B", b, Gecode::ICL_DOM) |
| MultXXX | Test::Int::Arithmetic::mult_xxx_d_c ("C", c, Gecode::ICL_DOM) |
| SqrXY | Test::Int::Arithmetic::sqr_xy_b_a ("A", a, Gecode::ICL_BND) |
| SqrXY | Test::Int::Arithmetic::sqr_xy_b_b ("B", b, Gecode::ICL_BND) |
| SqrXY | Test::Int::Arithmetic::sqr_xy_b_c ("C", c, Gecode::ICL_BND) |
| SqrXY | Test::Int::Arithmetic::sqr_xy_d_a ("A", a, Gecode::ICL_DOM) |
| SqrXY | Test::Int::Arithmetic::sqr_xy_d_b ("B", b, Gecode::ICL_DOM) |
| SqrXY | Test::Int::Arithmetic::sqr_xy_d_c ("C", c, Gecode::ICL_DOM) |
| SqrXX | Test::Int::Arithmetic::sqr_xx_b_a ("A", a, Gecode::ICL_BND) |
| SqrXX | Test::Int::Arithmetic::sqr_xx_b_b ("B", b, Gecode::ICL_BND) |
| SqrXX | Test::Int::Arithmetic::sqr_xx_b_c ("C", c, Gecode::ICL_BND) |
| SqrXX | Test::Int::Arithmetic::sqr_xx_d_a ("A", a, Gecode::ICL_DOM) |
| SqrXX | Test::Int::Arithmetic::sqr_xx_d_b ("B", b, Gecode::ICL_DOM) |
| SqrXX | Test::Int::Arithmetic::sqr_xx_d_c ("C", c, Gecode::ICL_DOM) |
| SqrtXY | Test::Int::Arithmetic::sqrt_xy_b_a ("A", a, Gecode::ICL_BND) |
| SqrtXY | Test::Int::Arithmetic::sqrt_xy_b_b ("B", b, Gecode::ICL_BND) |
| SqrtXY | Test::Int::Arithmetic::sqrt_xy_b_c ("C", c, Gecode::ICL_BND) |
| SqrtXY | Test::Int::Arithmetic::sqrt_xy_d_a ("A", a, Gecode::ICL_DOM) |
| SqrtXY | Test::Int::Arithmetic::sqrt_xy_d_b ("B", b, Gecode::ICL_DOM) |
| SqrtXY | Test::Int::Arithmetic::sqrt_xy_d_c ("C", c, Gecode::ICL_DOM) |
| SqrtXX | Test::Int::Arithmetic::sqrt_xx_b_a ("A", a, Gecode::ICL_BND) |
| SqrtXX | Test::Int::Arithmetic::sqrt_xx_b_b ("B", b, Gecode::ICL_BND) |
| SqrtXX | Test::Int::Arithmetic::sqrt_xx_b_c ("C", c, Gecode::ICL_BND) |
| SqrtXX | Test::Int::Arithmetic::sqrt_xx_d_a ("A", a, Gecode::ICL_DOM) |
| SqrtXX | Test::Int::Arithmetic::sqrt_xx_d_b ("B", b, Gecode::ICL_DOM) |
| SqrtXX | Test::Int::Arithmetic::sqrt_xx_d_c ("C", c, Gecode::ICL_DOM) |
| DivMod | Test::Int::Arithmetic::divmod_a_bnd ("A", a) |
| DivMod | Test::Int::Arithmetic::divmod_b_bnd ("B", b) |
| DivMod | Test::Int::Arithmetic::divmod_c_bnd ("C", c) |
| Div | Test::Int::Arithmetic::div_a_bnd ("A", a) |
| Div | Test::Int::Arithmetic::div_b_bnd ("B", b) |
| Div | Test::Int::Arithmetic::div_c_bnd ("C", c) |
| Mod | Test::Int::Arithmetic::mod_a_bnd ("A", a) |
| Mod | Test::Int::Arithmetic::mod_b_bnd ("B", b) |
| Mod | Test::Int::Arithmetic::mod_c_bnd ("C", c) |
| AbsXY | Test::Int::Arithmetic::abs_xy_b_a ("A", a, Gecode::ICL_BND) |
| AbsXY | Test::Int::Arithmetic::abs_xy_b_b ("B", b, Gecode::ICL_BND) |
| AbsXY | Test::Int::Arithmetic::abs_xy_b_c ("C", c, Gecode::ICL_BND) |
| AbsXY | Test::Int::Arithmetic::abs_xy_d_a ("A", a, Gecode::ICL_DOM) |
| AbsXY | Test::Int::Arithmetic::abs_xy_d_b ("B", b, Gecode::ICL_DOM) |
| AbsXY | Test::Int::Arithmetic::abs_xy_d_c ("C", c, Gecode::ICL_DOM) |
| AbsXX | Test::Int::Arithmetic::abs_xx_b_a ("A", a, Gecode::ICL_BND) |
| AbsXX | Test::Int::Arithmetic::abs_xx_b_b ("B", b, Gecode::ICL_BND) |
| AbsXX | Test::Int::Arithmetic::abs_xx_b_c ("C", c, Gecode::ICL_BND) |
| AbsXX | Test::Int::Arithmetic::abs_xx_d_a ("A", a, Gecode::ICL_DOM) |
| AbsXX | Test::Int::Arithmetic::abs_xx_d_b ("B", b, Gecode::ICL_DOM) |
| AbsXX | Test::Int::Arithmetic::abs_xx_d_c ("C", c, Gecode::ICL_DOM) |
| MinXYZ | Test::Int::Arithmetic::min_xyz_b_a ("A", a, Gecode::ICL_BND) |
| MinXYZ | Test::Int::Arithmetic::min_xyz_b_b ("B", b, Gecode::ICL_BND) |
| MinXYZ | Test::Int::Arithmetic::min_xyz_b_c ("C", c, Gecode::ICL_BND) |
| MinXYZ | Test::Int::Arithmetic::min_xyz_d_a ("A", a, Gecode::ICL_DOM) |
| MinXYZ | Test::Int::Arithmetic::min_xyz_d_b ("B", b, Gecode::ICL_DOM) |
| MinXYZ | Test::Int::Arithmetic::min_xyz_d_c ("C", c, Gecode::ICL_DOM) |
| MinXXY | Test::Int::Arithmetic::min_xxy_b_a ("A", a, Gecode::ICL_BND) |
| MinXXY | Test::Int::Arithmetic::min_xxy_b_b ("B", b, Gecode::ICL_BND) |
| MinXXY | Test::Int::Arithmetic::min_xxy_b_c ("C", c, Gecode::ICL_BND) |
| MinXXY | Test::Int::Arithmetic::min_xxy_d_a ("A", a, Gecode::ICL_DOM) |
| MinXXY | Test::Int::Arithmetic::min_xxy_d_b ("B", b, Gecode::ICL_DOM) |
| MinXXY | Test::Int::Arithmetic::min_xxy_d_c ("C", c, Gecode::ICL_DOM) |
| MinXYX | Test::Int::Arithmetic::min_xyx_b_a ("A", a, Gecode::ICL_BND) |
| MinXYX | Test::Int::Arithmetic::min_xyx_b_b ("B", b, Gecode::ICL_BND) |
| MinXYX | Test::Int::Arithmetic::min_xyx_b_c ("C", c, Gecode::ICL_BND) |
| MinXYX | Test::Int::Arithmetic::min_xyx_d_a ("A", a, Gecode::ICL_DOM) |
| MinXYX | Test::Int::Arithmetic::min_xyx_d_b ("B", b, Gecode::ICL_DOM) |
| MinXYX | Test::Int::Arithmetic::min_xyx_d_c ("C", c, Gecode::ICL_DOM) |
| MinXYY | Test::Int::Arithmetic::min_xyy_b_a ("A", a, Gecode::ICL_BND) |
| MinXYY | Test::Int::Arithmetic::min_xyy_b_b ("B", b, Gecode::ICL_BND) |
| MinXYY | Test::Int::Arithmetic::min_xyy_b_c ("C", c, Gecode::ICL_BND) |
| MinXYY | Test::Int::Arithmetic::min_xyy_d_a ("A", a, Gecode::ICL_DOM) |
| MinXYY | Test::Int::Arithmetic::min_xyy_d_b ("B", b, Gecode::ICL_DOM) |
| MinXYY | Test::Int::Arithmetic::min_xyy_d_c ("C", c, Gecode::ICL_DOM) |
| MinXXX | Test::Int::Arithmetic::min_xxx_b_a ("A", a, Gecode::ICL_BND) |
| MinXXX | Test::Int::Arithmetic::min_xxx_b_b ("B", b, Gecode::ICL_BND) |
| MinXXX | Test::Int::Arithmetic::min_xxx_b_c ("C", c, Gecode::ICL_BND) |
| MinXXX | Test::Int::Arithmetic::min_xxx_d_a ("A", a, Gecode::ICL_DOM) |
| MinXXX | Test::Int::Arithmetic::min_xxx_d_b ("B", b, Gecode::ICL_DOM) |
| MinXXX | Test::Int::Arithmetic::min_xxx_d_c ("C", c, Gecode::ICL_DOM) |
| MaxXYZ | Test::Int::Arithmetic::max_xyz_b_a ("A", a, Gecode::ICL_BND) |
| MaxXYZ | Test::Int::Arithmetic::max_xyz_b_b ("B", b, Gecode::ICL_BND) |
| MaxXYZ | Test::Int::Arithmetic::max_xyz_b_c ("C", c, Gecode::ICL_BND) |
| MaxXYZ | Test::Int::Arithmetic::max_xyz_d_a ("A", a, Gecode::ICL_DOM) |
| MaxXYZ | Test::Int::Arithmetic::max_xyz_d_b ("B", b, Gecode::ICL_DOM) |
| MaxXYZ | Test::Int::Arithmetic::max_xyz_d_c ("C", c, Gecode::ICL_DOM) |
| MaxXXY | Test::Int::Arithmetic::max_xxy_b_a ("A", a, Gecode::ICL_BND) |
| MaxXXY | Test::Int::Arithmetic::max_xxy_b_b ("B", b, Gecode::ICL_BND) |
| MaxXXY | Test::Int::Arithmetic::max_xxy_b_c ("C", c, Gecode::ICL_BND) |
| MaxXXY | Test::Int::Arithmetic::max_xxy_d_a ("A", a, Gecode::ICL_DOM) |
| MaxXXY | Test::Int::Arithmetic::max_xxy_d_b ("B", b, Gecode::ICL_DOM) |
| MaxXXY | Test::Int::Arithmetic::max_xxy_d_c ("C", c, Gecode::ICL_DOM) |
| MaxXYX | Test::Int::Arithmetic::max_xyx_b_a ("A", a, Gecode::ICL_BND) |
| MaxXYX | Test::Int::Arithmetic::max_xyx_b_b ("B", b, Gecode::ICL_BND) |
| MaxXYX | Test::Int::Arithmetic::max_xyx_b_c ("C", c, Gecode::ICL_BND) |
| MaxXYX | Test::Int::Arithmetic::max_xyx_d_a ("A", a, Gecode::ICL_DOM) |
| MaxXYX | Test::Int::Arithmetic::max_xyx_d_b ("B", b, Gecode::ICL_DOM) |
| MaxXYX | Test::Int::Arithmetic::max_xyx_d_c ("C", c, Gecode::ICL_DOM) |
| MaxXYY | Test::Int::Arithmetic::max_xyy_b_a ("A", a, Gecode::ICL_BND) |
| MaxXYY | Test::Int::Arithmetic::max_xyy_b_b ("B", b, Gecode::ICL_BND) |
| MaxXYY | Test::Int::Arithmetic::max_xyy_b_c ("C", c, Gecode::ICL_BND) |
| MaxXYY | Test::Int::Arithmetic::max_xyy_d_a ("A", a, Gecode::ICL_DOM) |
| MaxXYY | Test::Int::Arithmetic::max_xyy_d_b ("B", b, Gecode::ICL_DOM) |
| MaxXYY | Test::Int::Arithmetic::max_xyy_d_c ("C", c, Gecode::ICL_DOM) |
| MaxXXX | Test::Int::Arithmetic::max_xxx_b_a ("A", a, Gecode::ICL_BND) |
| MaxXXX | Test::Int::Arithmetic::max_xxx_b_b ("B", b, Gecode::ICL_BND) |
| MaxXXX | Test::Int::Arithmetic::max_xxx_b_c ("C", c, Gecode::ICL_BND) |
| MaxXXX | Test::Int::Arithmetic::max_xxx_d_a ("A", a, Gecode::ICL_DOM) |
| MaxXXX | Test::Int::Arithmetic::max_xxx_d_b ("B", b, Gecode::ICL_DOM) |
| MaxXXX | Test::Int::Arithmetic::max_xxx_d_c ("C", c, Gecode::ICL_DOM) |
| MinNary | Test::Int::Arithmetic::min_nary_b (Gecode::ICL_BND) |
| MinNary | Test::Int::Arithmetic::min_nary_d (Gecode::ICL_DOM) |
| MinNaryShared | Test::Int::Arithmetic::min_s_nary_b (Gecode::ICL_BND) |
| MinNaryShared | Test::Int::Arithmetic::min_s_nary_d (Gecode::ICL_DOM) |
| MaxNary | Test::Int::Arithmetic::max_nary_b (Gecode::ICL_BND) |
| MaxNary | Test::Int::Arithmetic::max_nary_d (Gecode::ICL_DOM) |
| MaxNaryShared | Test::Int::Arithmetic::max_s_nary_b (Gecode::ICL_BND) |
| MaxNaryShared | Test::Int::Arithmetic::max_s_nary_d (Gecode::ICL_DOM) |


BOSshell is a shell for the TI-84+CE, written in ICE compiler language.
This project is not yet finished; no where near finished considering my high hopes for it.
This page is likely to be updated on a weekly basis, so come back often!
If you would like to become a registered BOSshell developer, please contact me through Cemetech.
The form will be posted when the shell is nearing completion.
beckadamtheinventor (2018/May)


Create random maps for The Settlers II and RttR!
This is an old version! Also check out the current version!
A seed will determine the general shape of the land created. Everything else that will be done after seed will be based on what the seed tells. Only a few things will not depend on it (such as random noise or player placement).
Unlike other map generators the seed in this generator is the size of the map. This gives you a lot of potential for creating a great variety of different kinds of maps with the same tool and same generic rules that are applied based on the seed.
Tips:
Super flat: 1, 1, 999, 999, 999, 999 (1 - 30 starting points)
Mars: 1, 999, 500, 500, 500, 500 (1 - 30 starting points)
Height map determines the flatness or roughness of the map. Water is placed on the Base Level, while mountains are determined with their own logic. In the next step you can choose what will actually represent "water" and what will be "land". Mountains are such a hard requirement in the game that you can't directly replace them with another texture.
Here you can control the general appearance, feel and playability of the map via textures. You can choose between three different terrains and control representation of general "land" and "water" areas. For instance, you can replace water with lava or prefer savannah over meadows.
Nothing special here: just set the number of players and the engine attempts to generate as many players as you want.
Sorry, no customization options available at this time.
Once the TODO list above is complete... we are out of alpha and then good enough for GitHub.
Read more about the games at settlers2.net


Setting up BMS Primary on Eclipse C/C++
Although the foxBMS comes with foxConda, which is a graphic interface for configurations, it is not available for developers to add further features to the system. In the following, I will go through the step to get foxBMS running on a free IDE for embedded systems - Eclipse. There are many others IDE that we can use, such as Keil, or Visual Studio but they are either restricted or not free. So, the reason to use Eclipse is clear: developers have a free, open IDE and compatible with foxConda.
Requirements:
Written on December 23, 2017


Links:
| Climate Change | U.S. Environmental Protection Agency |
| Web browser interface to WEPP model | National Soil Erosion Research Lab |
| WEPP Software | National Soil Erosion Research Lab |
| Forest Service WEPP Interfaces | Rocky Mountain Research Station - Moscow Forestry Sciences Laboratory |
| Cligen Weather Generator | USDA Agricultural Research Service and U. S. Forest Service |
| BASINS: Better Assessment Science Integrating Point & Nonpoint Sources | U.S. Environmental Protection Agency |
| Parameter-elevation Regressions on Independent Slopes Model (PRISM) | PRISM Group |


TODO: Logo hier einfügen
Ivy is a modern, minimalistic and efficient 3D framework. It can be used as a rendering and ecs backend for your game or simulation. Supported platforms are Windows 10 and GNU/Linux with a kernel >= 5.0. Note that this is my honours project for my bachelors degree in Games Programming at SAE Institute Munich.
Get started by cloning this repository: git clone https://github.com/TKscoot/Ivy/
On Windows Visual Studio 2017 or 2019 are recommended. Compiling on Linux was tested with GCC. LLVM/Clang could work but has not been tested.
Generate project files with Premake5. Make sure your premake executable is in the root folder of the Ivy repository or in your %PATH%. Open a command prompt and navigate to the repo root folder and execute following commands.
For Visual Studio 2017 do:
For Visual Studio 2019 do:
Then open the Solution and build it inside Visual Studio.
The .lib file of the Ivy Framework can be found in Build/Bin
The .lib files of the external libraries can be found in projects/Ivy/dependencies
Make sure you have the correct GCC version and premake5 installed.
Every distribution
Download premake-5.0.0-alpha15-linux.tar.gz from the Premake Homepage. Unpack the content to your Ivy repository folder or any folder in your path.
Arch Linux
Information about Premake5 and all supported project file generators can be found here!
To generate a GNU makefile with premake you need to execute following command:
To build Ivy just type:
The demo program can be run from Build/Bin/Sandbox/<configuration>.
To use the framework you have to link against following libraries: Ivy GLAD ImGui glfw assimp
Linking only to Ivy
is coming soon™.
If you want to use premake for your project you can use the "Sandbox" template project from the premake5.lua file in the root of the repo.


Virtual circuit networks provide a connection for data transfer at the network level.
Virtual Circuit Networks setup a connection between routers to allow for a path for consistent (and reliable) host to host data transfer (as opposed to connectionless data transfer which can send packets out of order).
This relay connection provided is possible due to each of the routers sharing a VC number (which can be different). If the numbers had to be the same, each router would have to negotiate which numbers would be appropriate (this would end up taking too much time for it to be efficient).
In order to setup a VC connection, signaling messages are sent to the routers to let them know that a VC connection is going to be established. Protocols that setup these connections between routers are known as signaling protocols.
Datagram Networks: Connectionless Networking
Unlike setting up a VC network, alternatively packets can be sent through routers without a base connection, although this doesn't provide a good gurantee as to whether packets sent between hosts will arrive in order.
Generally, Datagram network send packets through various routers (which map the packets towards a destination), packets don't necessarily get sent along a specific path.
How do routers worK?
On the hardware end, routers physically take packet inputs and forward them to their destination (after mapping their route). During the software side, router processing occurs in order to determine network congestion, handle packet parameters, and perform the actual mapping processes on packets going through.
When packets are sent to the router, they're stored in a queue while in order to wait while the first packets that arrived are being processed and handled. After the first packets are done being processed, the router then takes packets from the queue, and processes them in the same way.
Depending on the processing speed and bandwidth, having packets in the queue of a router could eventually lead to packet loss if there's a large amount of network congestion; if all hosts send packets too fast to the router, the router will inevitably drop packets due to its buffer being full. The better the router, the more packets it can handle before it's queue becomes too full and packets start to be dropped.


What is Dementia?

Why Brain Health?
Brain health is important to your life. It allows you to recognize your family and friends, make decisions, and perform everyday tasks like eating.
Why should you care about Dementia?
 Currently, nearly 50 million people worldwide have dementia and over 70 million will have it by 2030.
Dementia is not a part of “normal” aging. It’s a major cause of disability, dependency, and stress for families. Current medical procedures for diagnosing dementia are often complex and expensive.
Why brainHealthDx?
brainHealthDx is a simple and accessible test that integrates rigorous scientific research and advanced data science to assess brain health. We work hard to ensure our test gives you high-quality information about your brain health that’s scientifically-grounded, data-driven, and ethically-mindful.
While our goal is not to replace medical assessments given by medical experts, we hope brainHealthDx helps reduce barriers to evaluating brain health and encourages those who may be at risk of dementia to proactively seek preventative care. brainHealthDx seeks to empower you to live fulfilling and healthy lives by allowing you to easily and quickly evaluate your brain health—wherever, whenever.
Want to know more about your brain health? Take our Test.


Race Mode
Entry a new car number.
Car Number
Drivers (ID to Name)
Race Time: sec.
Firstest Lap
Report (Best Lap)
| No. | Laps | Total | Best Lap | Actions |
|---|---|---|---|---|
Results
| No. | Laps | Total | Lap |
|---|---|---|---|
Entry a new car number.
| No. | Laps | Total | Best Lap | Actions |
|---|---|---|---|---|
| No. | Laps | Total | Lap |
|---|---|---|---|


|
Xenomai
3.0.4
|
Virtual files provide a mean to export Xenomai object states to user-space, based on common kernel interfaces. More...
Data Structures | |
| struct | xnvfile_lock_ops |
| Vfile locking operations. More... | |
| struct | xnvfile_regular_ops |
| Regular vfile operation descriptor. More... | |
| struct | xnvfile_regular_iterator |
| Regular vfile iterator. More... | |
| struct | xnvfile_snapshot_ops |
| Snapshot vfile operation descriptor. More... | |
| struct | xnvfile_rev_tag |
| Snapshot revision tag. More... | |
| struct | xnvfile_snapshot |
| Snapshot vfile descriptor. More... | |
| struct | xnvfile_snapshot_iterator |
| Snapshot-driven vfile iterator. More... | |
Functions | |
| int | xnvfile_init_snapshot (const char *name, struct xnvfile_snapshot *vfile, struct xnvfile_directory *parent) |
| Initialize a snapshot-driven vfile. More... | |
| int | xnvfile_init_regular (const char *name, struct xnvfile_regular *vfile, struct xnvfile_directory *parent) |
| Initialize a regular vfile. More... | |
| int | xnvfile_init_dir (const char *name, struct xnvfile_directory *vdir, struct xnvfile_directory *parent) |
| Initialize a virtual directory entry. More... | |
| int | xnvfile_init_link (const char *from, const char *to, struct xnvfile_link *vlink, struct xnvfile_directory *parent) |
| Initialize a virtual link entry. More... | |
| void | xnvfile_destroy (struct xnvfile *vfile) |
| Removes a virtual file entry. More... | |
| ssize_t | xnvfile_get_blob (struct xnvfile_input *input, void *data, size_t size) |
| Read in a data bulk written to the vfile. More... | |
| ssize_t | xnvfile_get_string (struct xnvfile_input *input, char *s, size_t maxlen) |
| Read in a C-string written to the vfile. More... | |
| ssize_t | xnvfile_get_integer (struct xnvfile_input *input, long *valp) |
| Evaluate the string written to the vfile as a long integer. More... | |
Variables | |
| struct xnvfile_directory | cobalt_vfroot |
| Xenomai vfile root directory. More... | |
| struct xnvfile_directory | cobalt_vfroot |
| Xenomai vfile root directory. More... | |
Virtual files provide a mean to export Xenomai object states to user-space, based on common kernel interfaces.
This encapsulation is aimed at:
This virtual file implementation offers record-based read support based on seq_files, single-buffer write support, directory and link handling, all visible from the /proc namespace.
The vfile support exposes four filesystem object types:
Because a large number of records may have to be output, the data collection phase is not strictly atomic as a whole, but only protected at record level. The vfile implementation can be notified of updates to the underlying data set, and restart the collection from scratch until the snapshot is fully consistent.
| void xnvfile_destroy | ( | struct xnvfile * | vfile | ) |
Removes a virtual file entry.
| vfile | A pointer to the virtual file descriptor to remove. |
| ssize_t xnvfile_get_blob | ( | struct xnvfile_input * | input, |
| void * | data, | ||
| size_t | size | ||
| ) |
Read in a data bulk written to the vfile.
When writing to a vfile, the associated store() handler from the snapshot-driven vfile or regular vfile is called, with a single argument describing the input data. xnvfile_get_blob() retrieves this data as an untyped binary blob, and copies it back to the caller's buffer.
| input | A pointer to the input descriptor passed to the store() handler. |
| data | The address of the destination buffer to copy the input data to. |
| size | The maximum number of bytes to copy to the destination buffer. If size is larger than the actual data size, the input is truncated to size. |
Referenced by xnvfile_get_integer(), and xnvfile_get_string().
| ssize_t xnvfile_get_integer | ( | struct xnvfile_input * | input, |
| long * | valp | ||
| ) |
Evaluate the string written to the vfile as a long integer.
When writing to a vfile, the associated store() handler from the snapshot-driven vfile or regular vfile is called, with a single argument describing the input data. xnvfile_get_integer() retrieves and interprets this data as a long integer, and copies the resulting value back to valp.
The long integer can be expressed in decimal, octal or hexadecimal bases depending on the prefix found.
| input | A pointer to the input descriptor passed to the store() handler. |
| valp | The address of a long integer variable to receive the value. |
References xnvfile_get_blob().
| ssize_t xnvfile_get_string | ( | struct xnvfile_input * | input, |
| char * | s, | ||
| size_t | maxlen | ||
| ) |
Read in a C-string written to the vfile.
When writing to a vfile, the associated store() handler from the snapshot-driven vfile or regular vfile is called, with a single argument describing the input data. xnvfile_get_string() retrieves this data as a null-terminated character string, and copies it back to the caller's buffer.
| input | A pointer to the input descriptor passed to the store() handler. |
| s | The address of the destination string buffer to copy the input data to. |
| maxlen | The maximum number of bytes to copy to the destination buffer, including the ending null character. If maxlen is larger than the actual string length, the input is truncated to maxlen. |
References xnvfile_get_blob().
| int xnvfile_init_dir | ( | const char * | name, |
| struct xnvfile_directory * | vdir, | ||
| struct xnvfile_directory * | parent | ||
| ) |
Initialize a virtual directory entry.
| name | The name which should appear in the pseudo-filesystem, identifying the vdir entry. |
| vdir | A pointer to the virtual directory descriptor to initialize. |
| parent | A pointer to a virtual directory descriptor standing for the parent directory of the new vdir. If NULL, the /proc root directory will be used. /proc/xenomai is mapped on the globally available cobalt_vfroot vdir. |
| int xnvfile_init_link | ( | const char * | from, |
| const char * | to, | ||
| struct xnvfile_link * | vlink, | ||
| struct xnvfile_directory * | parent | ||
| ) |
Initialize a virtual link entry.
| from | The name which should appear in the pseudo-filesystem, identifying the vlink entry. |
| to | The target file name which should be referred to symbolically by name. |
| vlink | A pointer to the virtual link descriptor to initialize. |
| parent | A pointer to a virtual directory descriptor standing for the parent directory of the new vlink. If NULL, the /proc root directory will be used. /proc/xenomai is mapped on the globally available cobalt_vfroot vdir. |
| int xnvfile_init_regular | ( | const char * | name, |
| struct xnvfile_regular * | vfile, | ||
| struct xnvfile_directory * | parent | ||
| ) |
Initialize a regular vfile.
| name | The name which should appear in the pseudo-filesystem, identifying the vfile entry. |
| vfile | A pointer to a vfile descriptor to initialize from. The following fields in this structure should be filled in prior to call this routine: |
| parent | A pointer to a virtual directory descriptor; the vfile entry will be created into this directory. If NULL, the /proc root directory will be used. /proc/xenomai is mapped on the globally available cobalt_vfroot vdir. |
| int xnvfile_init_snapshot | ( | const char * | name, |
| struct xnvfile_snapshot * | vfile, | ||
| struct xnvfile_directory * | parent | ||
| ) |
Initialize a snapshot-driven vfile.
| name | The name which should appear in the pseudo-filesystem, identifying the vfile entry. |
| vfile | A pointer to a vfile descriptor to initialize from. The following fields in this structure should be filled in prior to call this routine: |
| parent | A pointer to a virtual directory descriptor; the vfile entry will be created into this directory. If NULL, the /proc root directory will be used. /proc/xenomai is mapped on the globally available cobalt_vfroot vdir. |
| struct xnvfile_directory cobalt_vfroot |
Xenomai vfile root directory.
This vdir maps the /proc/xenomai directory. It can be used to create a hierarchy of Xenomai-related vfiles under this root.
| struct xnvfile_directory cobalt_vfroot |
Xenomai vfile root directory.
This vdir maps the /proc/xenomai directory. It can be used to create a hierarchy of Xenomai-related vfiles under this root.


Just a few more things before you publish:
Add a category: how would you categorize your exploration?
Verify the language: is your exploration written in this language?
Add tags to help learners discover your exploration.


class: center, middle, inverse, title-slide # Lectures 16–17 ## Basics for Coding Optimization Problems ### Tyler Ransom ### ECON 5253, University of Oklahoma --- # Plan for the day (and next time) - Introduction to numerical optimization techniques - Discuss various trade-offs associated with the most common optimization algorithms - Show how to code and evaluate an optimization problem in R - Discuss what the cost function looks like for the most well-known statistical models and ML algorithms --- # Basics of functional optimization - All statistical estimators are either minima of some error (aka "cost") function or maxima of some likelihood function - Examples: - linear regression (OLS) - logistic regression - naive Bayes classification - Multi-Layer Perceptron (MLP) aka artifical neural networks (ANN) - support vector machine (SVM) - ... - many others --- # Basics of functional optimization - Some estimators (e.g. OLS, Generalized Method of Moments) have .hi[closed form] solutions for the extremum value - we covered this in our previous lecture - Other estimators (e.g. MLE, some non-linear least squares) require .hi[numerical methods] to find the extremum value - we also showed this in the previous lecture (the case of logistic regression) - There are a number of different algorithms to numerically find extrema ("guess-and-check") - You can use these in R, Python, Julia, Matlab, ... --- # Graph of the optimization problem .center[  ] This is a graph of a likelihood function The parameters are on the `\(x\)` and `\(y\)` axes and the likelihood is on the `\(z\)` axis --- # How numerical optimization works - User provides an .hi[objective function] and a .hi[starting value] - The optimizer then calculates the magnitude and direction of the .hi[gradient vector] at the starting value - Given these values of the gradient vector, it decides - in which direction to move to get closer to the optimum - how far it should move to get closer to the optimum - Given the magnitude and direction of the gradient vector at the new point, it repeats these steps until convergence is achieved --- # How to determine convergence? 1. The gradient vector (or Jacobian matrix) is numerically close to 0 (within `\(10^{-6}\)`) - Intuition: we may be at an extremum if the derivative is 0 2. The location of the previous guess is numerically close to the location of the updated guess - Intuition: The optimizer didn't move very far in updating the guess, so we're probably close to the answer 3. The value of the objective function at the previous guess is numerically close to the value of the objective function at the updated guess - Intuition: The objective function is flat in the area of the previous and updated guesses, which is kind of like having a gradient of zero --- # Local or global minimum? - Note that in the previous slide, no mention of second-order conditions was ever made - Hence, it is unclear if the answer our optimizer gave is a local optimum, a saddle point, or a global optimum - Luckily, most common statistical estimators have been proven to have .hi[globally concave] objective functions - If you are unsure whether or not your objective function is globally concave, you can try different sets of starting values and see how much the answers differ *Note:* "globally concave" simply means that the function has only one "hump" or only one "dip" which means we will eventually get to the only extremum --- # Most commonly used optimization algorithms - Gradient descent - Stochastic gradient descent - BFGS/L-BFGS - Nelder-Mead (gradient-free simplex methods) - Gauss-Newton --- # When should I use which algorithm? - It turns out that optimization can often be more of an "art" than a "science" - Often times your choice of objective function will dictate which optimization algorithm you should choose - We'll talk more about these considerations a bit later --- # How to use these in R? - R has several packages for calling these commonly used optimizers, as well as many others - In a future problem set, you will get experience with the packages `optimr` and `nloptr` - Sadly, R is not the best language to be using if you need to optimize your own functions - I recommend Python, Matlab, or (especially) Julia! - We exclusively use Julia in my PhD-level econometrics class --- # Gradient descent What is gradient descent? - Pretend you are on a mountain and there's a valley below that you're trying to get to - There's a fog over the whole mountain, such that you can't see down the mountain - You want to get down the mountain as quickly as possible - You have a special compass that will tell you the steepness of the hill in every direction - It's costly to look at the compass - You need to decide how often to look at the compass (i.e. how far to walk before checking the compass and potentially changing direction) The best way down the mountain is to follow the path of steepest descent while taking the minimum number of stops to look at the compass --- # The math behind Gradient descent - Start with some initial value (call it `\(x_0\)`) and some step size (call it `\(\gamma\)`) - The new guess of the solution is equal to `\begin{align*} x_n &= x_0 - \gamma\nabla f(x_0) \end{align*}` where `\(\nabla f(x_0)\)` is the gradient vector of our objective function `\(f(\cdot)\)` Repeat this process until convergence (i.e. until `\(\nabla f(x_0)\)` is arbitrarily close to 0, until `\(x\)` doesn't change across iterations, or until `\(f(x)\)` doesn't change across iterations --- # Famous quote "Victory will never be found by taking the line of least resistance." -- Winston Churchill - But in actuality, with gradient descent, victory *is* found by taking the line of (steepest descent)! --- # Gradient descent in R Suppose we want to find the minimum of `\(f(x) = x^4 - 3x^3 + 2\)` .scroll-box-14[ ```r # set up a stepsize alpha <- 0.003 # set up a number of iteration iter <- 500 # define the gradient of f(x) = x^4 - 3*x^3 + 2 gradient <- function(x) return((4*x^3) - (9*x^2)) # randomly initialize a value to x set.seed(100) x <- floor(runif(1)*10) # create a vector to contain all xs for all steps x.All <- vector("numeric",iter) # gradient descent method to find the minimum for(i in 1:iter){ x <- x - alpha*gradient(x) x.All[i] <- x print(x) } # print result and plot all xs for every iteration print(paste("The minimum of f(x) is ", x, sep = "")) ``` ] Want to do it in Julia? see [here](https://github.com/tyleransom/DScourseS21/blob/master/LectureNotes/16_17-Opt/simpleGD.jl) --- # How to write a function in R How do you write a function in R? The function has four distinct elements: 1. Name 2. Arguments (aka inputs) 3. Statements (i.e. code) 4. Outputs ```r myfunction <- function(arg1, arg2, ... ){ statements return(object) } ``` Note the braces! --- # Calling a function Once you have your function written, you call it as follows: ```r output <- myfunction(arg1, arg2, ...) ``` where `output` can be any name you'd like, and `arg1` etc. are the specific arguments you're interested in --- # Example of a simple function .scroll-box-20[ ```r customMean <- function(x){ mean <- sum(x)/length(x) return(mean) } # Now let's call the function sample.average <- customMean(iris$Sepal.Width) print(sample.average) # Check that it's correct mean(iris$Sepal.Width) ``` ] --- # Function scope - It doesn't matter what you name your variables when you call the function - i.e. when we called `customMean()` above, we sent it `iris$Sepal.Width` even though we called the input `x` in the function definition - This is all to say that when a function is *evaluated*, its new workspace is whatever is sent to the function - This is important to keep in mind when trying to optimize your own objective function --- # Function scope .center[  ] --- # Using `nloptr` Now that we know how to write a function, let's optimize the same function we did before (using gradient descent) but instead now let's use one of the optimizers in the `nloptr` package To use the package we need to provide the following information: - Objective function - Gradient vector of the objective function - Algorithm - Initial value - Tolerance parameter --- # Code .scroll-box-14[ ```r library(nloptr) # Our objective function eval_f <- function(x) { return( x[1]^4 - 3*x[1]^3 + 2 ) } # Gradient of our objective function eval_grad_f <- function(x) { return( 4*x[1]^3 - 9*x[1]^2 ) } # initial values x0 <- -5 # Algorithm parameters opts <- list("algorithm"="NLOPT_LD_LBFGS","xtol_rel"=1.0e-8) # Find the optimum! res <- nloptr( x0=x0,eval_f=eval_f,eval_grad_f=eval_grad_f,opts=opts) print(res) ``` ] Want to do it in Julia? see [here](https://github.com/tyleransom/DScourseS20/blob/master/ModelingOptimization/LBFGS.jl) --- # Comparison with previous result As you can see, we got the same result using this method as we did with our simple gradient descent --- # What if my function isn't differentiable? By now you might be wondering how we can find the optimum of a function that is not differentiable The answer is to use what's called a "simplex method" --- # Simplex method A simplex is a multi-dimensional triangle (see video clip [here](https://www.youtube.com/watch?v=j2gcuRVbwR0)) Rather than find the "steepest" path, the triangle moves around to find lower spots of the objective function The triangle can do one of many operations: - reflect - expand - contract - shrink The alogrithm uses the ordering of the points of the mutli-dimensional triangle to figure out which operation it should next use in order to find the minimum --- # Nelder-Mead code ```r library(nloptr) # Our objective function objfun <- function(x) { return( x[1]^4 - 3*x[1]^3 + 2 ) } # initial values xstart <- 5 # Algorithm parameters options <- list("algorithm"="NLOPT_LN_NELDERMEAD","xtol_rel"=1.0e-8) # Find the optimum! res <- nloptr( x0=xstart,eval_f=objfun,opts=options) print(res) ``` --- # Computing OLS using `nloptr` Now let's see how we can actually optimize a statistical model using the `nloptr` package in R OLS objective function: .scroll-box-14[ ```r library(nloptr) # Our objective function objfun <- function(beta,y,X) { return (sum((y-X%*%beta)^2)) # equivalently, if we want to use matrix algebra: # return ( crossprod(y-X%*%beta) ) } # Gradient of our objective function gradient <- function(beta,y,X) { return ( as.vector(-2*t(X)%*%(y-X%*%beta)) ) } # read in the data y <- iris$Sepal.Length X <- model.matrix(~Sepal.Width+Petal.Length+Petal.Width+Species,iris) # initial values beta0 <- runif(dim(X)[2]) #start at uniform random numbers equal to number of coefficients # Algorithm parameters options <- list("algorithm"="NLOPT_LD_LBFGS","xtol_rel"=1.0e-6,"maxeval"=1e3) # Optimize! result <- nloptr( x0=beta0,eval_f=objfun,eval_grad_f=gradient,opts=options,y=y,X=X) print(result) # Check solution print(summary(lm(Sepal.Length~Sepal.Width+Petal.Length+Petal.Width+Species,data=iris))) ``` ] --- # MLE estimation using `nloptr` MLE objective function: .scroll-box-14[ ```r library(nloptr) # Our objective function objfun <- function(theta,y,X) { # need to slice our parameter vector into beta and sigma components beta <- theta[1:(length(theta)-1)] sig <- theta[length(theta)] # write objective function as *negative* log likelihood (since NLOPT minimizes) loglike <- -sum( -.5*(log(2*pi*(sig^2)) + ((y-X%*%beta)/sig)^2) ) return (loglike) } # read in the data y <- iris$Sepal.Length X <- model.matrix(~Sepal.Width+Petal.Length+Petal.Width+Species,iris) # initial values theta0 <- runif(dim(X)[2]+1) #start at uniform random numbers equal to number of coefficients theta0 <- append(as.vector(summary(lm(Sepal.Length~Sepal.Width+Petal.Length+Petal.Width+Species,data=iris))$coefficients[,1]),runif(1)) # Algorithm parameters options <- list("algorithm"="NLOPT_LN_NELDERMEAD","xtol_rel"=1.0e-6,"maxeval"=1e4) # Optimize! result <- nloptr( x0=theta0,eval_f=objfun,opts=options,y=y,X=X) print(result) betahat <- result$solution[1:(length(result$solution)-1)] sigmahat <- result$solution[length(result$solution)] # Check solution print(summary(lm(Sepal.Length~Sepal.Width+Petal.Length+Petal.Width+Species,data=iris))) ``` ] --- # Stochastic gradient descent (SGD) - The most popular way to optimize a neural network - (What does "stochastic" mean? Why is it called stochastic gradient descent?) - Recall regular gradient descent (often called .hi[batch gradient descent]): - Start with some initial value (call it x0) and some step size (call it `\(\gamma\)`) - The new guess of the solution is equal to `\begin{align*} x_n &= x_0 - \gamma\nabla f(x_0) \end{align*}` - Repeat this process until convergence --- # Stochastic gradient descent (continued) With SGD, we instead update the gradient for .hi[each observation] - each iteration now has N updates within it - we re-shuffle the data between each iteration --- # SGD on OLS Batch gradient descent first: .scroll-box-8[ ```r # set up a stepsize alpha <- 0.00003 # set up a number of iterations maxiter <- 500000 # Our objective function objfun <- function(beta,y,X) { return ( sum((y-X%*%beta)^2) ) } # define the gradient of our objective function gradient <- function(beta,y,X) { return ( as.vector(-2*t(X)%*%(y-X%*%beta)) ) } # read in the data y <- iris$Sepal.Length X <- model.matrix(~Sepal.Width+Petal.Length+Petal.Width+Species,iris) # initial values beta <- runif(dim(X)[2]) #start at uniform random numbers equal to number of coefficients # randomly initialize a value to beta set.seed(100) # create a vector to contain all beta's for all steps beta.All <- matrix("numeric",length(beta),maxiter) # gradient descent method to find the minimum iter <- 1 beta0 <- 0*beta while (norm(as.matrix(beta0)-as.matrix(beta))>1e-8) { beta0 <- beta beta <- beta0 - alpha*gradient(beta0,y,X) beta.All[,iter] <- beta if (iter%%10000==0) { print(beta) } iter <- iter+1 } # print result and plot all xs for every iteration print(iter) print(paste("The minimum of f(beta,y,X) is ", beta, sep = "")) # Closed-form solution print(summary(lm(Sepal.Length~Sepal.Width+Petal.Length+Petal.Width+Species,data=iris))) ``` ] Now SGD: .scroll-box-8[ ```r # set up a stepsize alpha <- 0.0003 # Our objective function objfun <- function(beta,y,X) { return ( sum((y-X%*%beta)^2) ) } # define the gradient of our objective function gradient <- function(beta,y,X) { return ( as.vector(-2*X%*%(y-t(X)%*%beta)) ) } # read in the data y <- iris$Sepal.Length X <- model.matrix(~Sepal.Width+Petal.Length+Petal.Width+Species,iris) # initial values beta <- runif(dim(X)[2]) #start at uniform random numbers equal to number of coefficients # randomly initialize a value to beta set.seed(100) # create a vector to contain all beta's for all steps beta.All <- matrix("numeric",length(beta),iter) # stochastic gradient descent method to find the minimum iter <- 1 beta0 <- 0*beta while (norm(as.matrix(beta0)-as.matrix(beta))>1e-12) { # Randomly re-order the data random <- sample(nrow(X)) X <- X[random,] y <- y[random] # Update parameters for each row of data for(i in 1:dim(X)[1]){ beta0 <- beta beta <- beta0 - alpha*gradient(beta0,y[i],as.matrix(X[i,])) beta.All[,i] <- beta } alpha <- alpha/1.0005 if (iter%%1000==0) { print(beta) } iter <- iter+1 } # print result and plot all xs for every iteration print(iter) print(paste("The minimum of f(beta,y,X) is ", beta, sep = "")) # Closed-form solution print(summary(lm(Sepal.Length~Sepal.Width+Petal.Length+Petal.Width+Species,data=iris))) ``` ] --- # Why is SGD useful? Pros: - much faster (if properly tuned) - can be parallelized fairly easily - can be used for streaming data - randomness in data across observations can help it find global optima - Gauss-Newton, L-BFGS can't be used for Big Data sets Cons: - convergence is more complicated - slower in R (since loops are awful) - must slowly decrease `alpha` (the learning rate) to achieve convergence --- # Mini-batch gradient descent - combines batch gradient descent and SGD - loop over groups of observations (instead of each observation) - can improve performance --- # Cost functions of commonly used algorithms The next few slides will discuss the cost functions of: - Linear regression (OLS) - Logistic regression - Classification and Regression Trees (CARTs) - Naive Bayes - Support Vector Machine (SVM) --- # Linear regression (least squares) ```r objfun <- sum((y-X%*%beta)^2) objfun <- crossprod(y-X%*%beta) ``` or (if normal MLE): ```r loglike <- -sum( -.5*(log(2*pi*(sig^2)) + ((Y-X%*%beta)/sig)^2) ) ``` --- # Logistic regression (foundation of neural networks) ```r loglike <- -sum( (y==1)*(log(h(X%*%beta))) + (y==0)*(log(1-h(X%*%beta))) ) where h(X%*%beta) = exp(X%*%beta)/(1+exp(X%*%beta)) ``` Note: `\(h(\cdot)\)` is also known as the .hi[sigmoid function] or the .hi[logistic function] --- # Classification and Regression Trees (CARTs) The cost function for a CART is a little more complicated because it is a two-step process: 1. Minimize within-leaf deviation (i.e. want all observations within a leaf to be as similar as possible) 2. Maximize across-leaf deviation (i.e. want each leaf to be as different as possible from all other leaves) Have to try various cut points (defining leaf boundaries) and see which configuration best satisfies the above criteria --- # Naive Bayes (classification or regression) This is called "naive" because the researcher makes the "naive" assumption that all of the X's are independent This is a powerful assumption because it significantly reduces the computation cost To estimate the model, simply compute the mean and standard deviation of each X variable Then plug into the pdf of the normal distribution and create predictions of y that satisfy Bayes' rule --- # Support Vector Machine (SVM) The cost function is similar to least squares, except it does not count errors that are sufficiently small: ```r costfun <- sum(max(0,1-y*(w%*%X))) + lambda/(sum(w^2)) ``` where `w` is the support vector which divides the sample space --- # Penalizing complexity As we will discuss in the coming lectures, prediction problems do better the more predictors there are But we should also penalize complexity The three ways to penalize complexity are: 1. LASSO model (aka L1 regularization): (absolute value of each additional parameter counts agains the objective function) 2. Ridge model (aka L2 regularization): (squared value of each additional parameter counts agains the objective function) 3. Elastic net model: A weighted average of 1. and 2. To penalize complexity, just add this term to the cost function (if minimizing) or subtract from objective function (if maximizing) --- # Helpful resources - An [overview](http://ruder.io/optimizing-gradient-descent/) of gradient descent optimization algorithms - My PhD econometrics [GitHub repository](https://github.com/OU-PhD-Econometrics/fall-2020)


$location.protocol() =
$location.host() =
$location.port() =
$location.path() =
$location.search() =
$location.hash() =
/base/first?a=b
|
sec/ond?flag#hash
|
external


To get started, press o
to open a file. Press
Tab
for filename completion. Use PgUp
,
PgDown
and the cursor keys to navigate. Press
h
to make this help text appear.
Within any entry box, you can use the Up
and
Down
keys to select an item from the history. When opening
a previously read file, the cursor will skip to the last known cursor
position.
Ctrl+G
Cancel the current operation.Ctrl+X
Quit.\

Search forwards.?

Show link URL.h
Display help text.t
Show full table of contents.T
Show short table of contents.b
Go to book text.o
Open file.
Copyright (C) 2012 Daniel Beer<EMAIL_ADDRESS>Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
 IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.


change
June 20, 2017
Trying to change my habits in a way it feels fun!
How I wish to change my life?
The past week had been pretty busy. To accompany this line, I would also like to say that I feel like I spend way too much time on my laptop (feeling busy) but not getting too much done correspondingly! :-(
I want a change
It’s time now — I am not gonna let this cut down my productivity, I will have to learn time management, and to make sure that this happens, I am gonna experiment some major changes in my routine.
Getting back to books again
I have started listening to the book: Happiness of Pursuit
Recently, an article from Max Deutsch caught my eye — (How to build a self driving car in one month) — which lead me to follow most of his work and to this book. This guy amazes me in every way possible — He reads books (a lot). He blogs (a lot) in a lot detail about everything he does. He cycles. He programs. He follows his passion [a lot**.
I also have gotten the book: Peak — Secrets from the new Science of Expertise. It’s in my listening list as well.
Learning
Learning how to learn Started this course - I always wanted to do this course, but never found time for this. It’s amongst my top priorities now.
Documenting
Blogging - It helps me to introspect my activities, so I will be changing my blogging habits, though I want to achieve one blog/day,I will be aiming at one blog every 2 days for now. Also, inspired by Max Deutsch! I find his blog to be an unending source of knowledge, practical experience and inspiration. Thank You Max Deutsch
Challenging my limits - I will take M2M (Month to Master) challenge this year. According to Max, M2M is:
I will spend the next year trying to master twelve expert-level skills — devoting one month to each skill and writing daily about the process.
I’m calling the project Month to Master (M2M). I haven’t thought of challenges as per, but you will most likely hear about it my next post.
Past days
Now, coming back to past days — the reason~s~ behind these developments: my to-do list had been accumulating ever since starting of this month. It feels like I don’t have enough time, but now, when I think of it - I have had enough time! Everything I had in there fell more or less in one of the following topics:
Running StackGen
Reference: https://github.com/hanzhanggit/StackGAN
A neural network which converts text -> images. You just need to write the description and you would have an image prepared. How cool is that!!
One of my seniors showed me their video, since then, I was tempted to make this thing work on my machine and see by myself. I spent nearly 6 hours trying to make it work in every possible way, but since my computer doesn’t have a NVIDIA chip, it won’t run CUDA and hence this didn’t run. But still, I learned many things in the process. :-)
coala
Getting back on coala Reference: https://coala.io
I am selected with coala for Google Summer of Code 2017. Though, I am keeping up with my schedule, I have some PR’s which were abandoned since I had been busy with exams and then, other stuff. I stated working on one of them, and man, rebasing it was quite hard, especially when one tries to rebase coala with a remote upstream pointing towards coala-bears ;) — Since, I was getting a lot of conflicts, I even wrote a script for skipping patches ;P. I noticed the mistake after digging for 30 mins. That was one hell of a facepalm moment.
Hacking on vulture
https://github.com/jendrikseipp/vulture
I have some issues pending, but I am pretty sure I can catch up on them. I have had already done a pretty good amount of research.
todoman
Configuring todoman - https://github.com/pimutils/todoman
todoman is a simple command line todo list manager, I have been using it for few months now and it’s pretty great. I am also trying to contribute to it.
After I changed my machine, I wasn’t able to color-code my lists, at first, thought I was doing something wrong, but after re-checking, I finally posted an issue — In fact, while writing this, I tried to open it in iTerm2 (to which I switched today ). it’s all colourful and I am happy again. :-)
Miscellaneous
- Helping my friend setting up her website
- My best friend has been trying to contribute to coala. I have been helping her. She is doing pretty great!
- Shutting Down my computer — I haven’t ever shut it down since it came! ;)
A lesson
What I think I did wrong was that I took up all these tasks simultaneously which resulted in a lot of chaos. I found more and more interesting things to do ( A different post ) — It was overwhelming. At a time, I had had more than 100 tabs opened in over 4 windows.
Then, I got up at 3PM today (I slept at 7 AM), and since then doing a clean up — reading/replying to all the emails. and closing all the tabs. After 12 hrs of deliberate work, I am trying to get things done. :-)
Next Post
What to expect in my next post?
- My study plan for this summer
- M2M challenges I would like to take up
- A list of interested things I want to do
PS: My spacebar seems a bit weird sometimes :/ , I suspect this might be either because of the posture in which I work sometimes or it might be a manufacturing defect.
I am just skeptical ;p
I am on a macbook air, if anyone has had any such experience, please share! ;-)


Add Feature Request
Title:
Description:
Client:
Client1
Client2
Client3
Priority:
1
2
3
4
5
Target Date:
Product Area:
Policies
Billing
Claims
Reports
Submit Feature Request
List Feature Request
Refresh List


📅 (2023-06-14 13:40:51 UTC)
# Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-num base Num library distributed with the OCaml compiler base-threads base base-unix base camlp5 7.14 Preprocessor-pretty-printer of OCaml conf-findutils 1 Virtual package relying on findutils conf-perl 2 Virtual package relying on perl coq 8.6 Formal proof management system num 0 The Num library for arbitrary-precision integer and rational arithmetic ocaml 4.04.2 The OCaml compiler (virtual package) ocaml-base-compiler 4.04.2 Official 4.04.2 release ocaml-config 1 OCaml Switch Configuration ocamlfind 1.9.6 A library manager for OCaml # opam file: opam-version: "2.0" maintainer<EMAIL_ADDRESS>homepage: "https://github.com/coq-contribs/continuations" license: "Unknown" build: [make "-j%{jobs}%"] install: [make "install"] remove: ["rm" "-R" "%{lib}%/coq/user-contrib/Continuations"] depends: [ "ocaml" "coq" {>= "8.6" & < "8.7~"} ] tags: [ "keyword: exceptions" "keyword: monads" "keyword: continuations" "keyword: cps" "category: Computer Science/Semantics and Compilation/Semantics" "category: Miscellaneous/Extracted Programs/Combinatorics" ] authors: [ "Jean-François Monin" ] bug-reports: "https://github.com/coq-contribs/continuations/issues" dev-repo: "git+https://github.com/coq-contribs/continuations.git" synopsis: "A toolkit to reason with programs raising exceptions" description: """ We show a way of developing correct functionnal programs raising exceptions. This is made possible using a Continuation Passing Style translation, see the contribution "exceptions" from P. Casteran at Bordeaux. Things are made easier and more modular using some general definitions.""" flags: light-uninstall url { src: "https://github.com/coq-contribs/continuations/archive/v8.6.0.tar.gz" checksum: "md5=048bd17ff2fd3e854c3c3384866430ad" }
true
Dry install with the current Coq version:
opam install -y --show-action coq-continuations.8.6.0 coq.8.6
Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:
true
opam list; echo; ulimit -Sv 4000000; timeout 4h opam install -y --deps-only coq-continuations.8.6.0 coq.8.6
opam list; echo; ulimit -Sv 16000000; timeout 4h opam install -y -v coq-continuations.8.6.0 coq.8.6
Total: 1 M
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/FOUnify_cps/deb_term_unif.glob
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/FOUnify_cps/deb_term_unif.vo
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/FOUnify_cps/end_term_unif.glob
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/FOUnify_cps/end_term_unif.vo
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/FOUnify_cps/nat_term_eq_quasiterm.vo
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/FOUnify_cps/nat_term_eq_quasiterm.glob
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/FOUnify_cps/deb_term_unif.v
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/weight/specif.vo
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/FOUnify_cps/is_in_quasiterm_term_subst.vo
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/FOUnify_cps/listv_is_in_lv.vo
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/weight/Nmxaccu_ex.vo
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/FOUnify_cps/end_term_unif.v
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/FOUnify_cps/nat_complements.vo
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/weight/Nmxaccu_ex.glob
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/cps/applytac.cmxs
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/polycont/huffman.vo
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/FOUnify_cps/is_in_quasiterm_term_subst.glob
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/weight/specif.glob
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/polycont/copy.vo
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/polycont/copy_cheat.vo
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/FOUnify_cps/nat_term_eq_quasiterm.v
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/weight/Nxaccu_ex.vo
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/weight/Naccu_cc.vo
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/FOUnify_cps/nat_complements.glob
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/FOUnify_cps/listv_is_in_lv.glob
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/weight/Naccu_cc.glob
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/weight/tests.vo
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/weight/Nxaccu_ex.glob
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/cps/cps_N.glob
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/polycont/huffman.glob
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/cps/cps_Nmx.glob
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/cps/cps_N.vo
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/FOUnify_cps/is_in_quasiterm_term_subst.v
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/weight/Nmxaccu_ex.v
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/weight/decl_exc.vo
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/weight/tree.vo
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/weight/specif.v
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/FOUnify_cps/nat_complements.v
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/cps/applytac.cmo
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/FOUnify_cps/listv_is_in_lv.v
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/polycont/copy_cheat.glob
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/polycont/copy.glob
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/cps/cps_Nmx.vo
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/polycont/Mx_defs.glob
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/cps/applytac.cmi
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/cps/cps_Nx.glob
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/weight/tree_plus.vo
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/weight/decl_exc.glob
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/weight/tree.glob
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/cps/cps_Nx.vo
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/polycont/Mx_defs.vo
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/polycont/huffman.v
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/weight/Nxaccu_ex.v
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/cps/cps_N.v
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/weight/Naccu_cc.v
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/weight/tree_plus.glob
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/cps/cps_Nmx.v
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/weight/decl_exc.v
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/polycont/copy_cheat.v
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/polycont/copy.v
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/weight/tree.v
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/cps/cps_Nx.v
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/cps/applytac.vo
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/weight/tests.glob
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/weight/tree_plus.v
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/weight/tests.v
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/polycont/Mx_defs.v
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/cps/applytac.v
../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/Continuations/cps/applytac.glob
opam remove -y coq-continuations.8.6.0


1001689246
Balaji, Manasa
Question 1
The average total time required to execute the restricted queries is {{ time_taken }} seconds
Time taken for each query
{{ list_of_times }}


{% macro auth() %}
To cancel all builds, fill out the following fields and push the 'Cancel' button
To cancel this build, fill out the following fields and push the 'Cancel' button
To cancel individual builds, click the 'Cancel' buttons above.
To cancel all builds for this change, push the 'Cancel' button
To cancel builds for this builder for a given change, fill out all fields and push the 'Cancel' button
To stop all builds, fill out the following field and push the Stop {{ label }} button
To stop selected builds, select the builders, fill out the following field and push the Stop {{ label }} button
To stop this build, fill out the following field and push the Stop {{ label }} button
To force a build on all Builders, fill out the following fields and push the 'Force Build' button
To force a build on certain Builders, select the builders, fill out the following fields and push the 'Force Build' button
To force a build, fill out the following fields and push the 'Force Build' button
To cause this slave to shut down gracefully when it is idle, push the 'Graceful Shutdown' button
To cause this master to shut down cleanly, push the 'Clean Shutdown' button.
No other builds will be started on this master, and the master will stop once all current builds are finished.
To cancel a previously initiated shutdown, push the 'Cancel Shutdown' button.
To ping the buildslave(s), push the 'Ping' button
This tree was built from a specific set of source files, and can be rebuilt exactly
This tree was built from the most recent revision {% if ss.branch %} (along branch {{ ss.branch }}) {% endif %} and thus it might not be possible to rebuild it exactly. Any changes that have been committed after this build was started will be included in a rebuild.
To show users, press the 'Show Users' button


State of Examples
Examples Running on Hoodie
angularjs
NOT Running on Hoodie yet
agilityjs
angularjs-perf
backbone
canjs
closure
dojo
emberjs
gwt
jquery
knockback
knockoutjs
maria
polymer
react
spine
yui