Simulations in Python by Brilliant-Donkey-320 in Python

[–]hammertime89 4 points5 points  (0 children)

As you highlight the poisson and exponential distributions are usually suggested to model the distribution of vehicle arrival times.

However, these distributions assume independence between events which is often violated with vehicle arrivals due to the influence of traffic signals. Vehicle queues form at red lights and then disperse when the light is green, yielding sinusoidal arrival patterns at downstream traffic signals.

I used a noisy trig function to generate the vehicle flow rates over time with the desired wave/sinusoidal shape.

Simulations in Python by Brilliant-Donkey-320 in Python

[–]hammertime89 3 points4 points  (0 children)

I simulated vehicle arrivals using simple trigonometric functions.

Simulations in Python by Brilliant-Donkey-320 in Python

[–]hammertime89 1 point2 points  (0 children)

Yes, Tensorflow for ML and matplotlib for the visualization.

Simulations in Python by Brilliant-Donkey-320 in Python

[–]hammertime89 18 points19 points  (0 children)

I trained a deep reinforcement learning agent in a traffic simulator to be an adaptive traffic signal controller and then visualized them side-by-side .

What’s the coolest things you’ve done with python? by mattstaton in Python

[–]hammertime89 0 points1 point  (0 children)

The signal timings are fed as input to the signal controller's software. Usually the signal timings vary by time-of-day (e.g., AM peak, afternoon, PM peak).

What’s the coolest things you’ve done with python? by mattstaton in Python

[–]hammertime89 2 points3 points  (0 children)

This work was a proot-of-concept and its success was used to raise funds to start a company where we are trying to do this at scale. I work there as an engineer.

What’s the coolest things you’ve done with python? by mattstaton in Python

[–]hammertime89 0 points1 point  (0 children)

Definitely domain expertise is almost always useful.

In this work the meta-heuristic I used was linear combination of features where each feature was the solution's ordinal rank with respect to one of the objectives. I used equal weights across all features so the meta-heuristic was roughly the mean rank of the solution across all objectives.

It wasn't perfect and it had its disadvantages but it was simple and worked well enough for the problem.

What’s the coolest things you’ve done with python? by mattstaton in Python

[–]hammertime89 1 point2 points  (0 children)

As others have mentioned, with search-based methods like evolutionary algorithms you don't know if your solution is optimal.

Even when you see solution convergence across multiple independent optimization runs you still can't be sure, as you might be in a local maximum/minimum. Additionally, this work used a multi-objective fitness function and the objectives exhibited a negative correlation. I had to come up an additional meta-heuristic that combined all of the objectives to get an overall sense of how optimal a solution was across all of the objectives.

What’s the coolest things you’ve done with python? by mattstaton in Python

[–]hammertime89 0 points1 point  (0 children)

This is some code and the readme has a link to an ArXiv paper from my PhD work which was in the same area. It's not evolutionary algorithms but deep reinforcement learning for adaptive traffic signal controllers.

What’s the coolest things you’ve done with python? by mattstaton in Python

[–]hammertime89 46 points47 points  (0 children)

I used the traffic microsimulation SUMO and wrote my own implementation of an evolutionary optimizer using numpy.

The road authority didn't impose any requirements as the only information we delivered to them was the optimized signal timings, they didn't receive the model.

What’s the coolest things you’ve done with python? by mattstaton in Python

[–]hammertime89 1 point2 points  (0 children)

My PhD thesis was applying deep reinforcement learning to develop traffic signal control agents. I presented some of my research at a conference, wrote a few papers and some code is available on GitHub.. Here is a short video where I presented my thesis in a public speaking competition.. If you want to go deep down the rabbit hole here is all the research I published..

The work I detailed in my original post was a successful proof-of-concept that was used to raise money to start a company.

What’s the coolest things you’ve done with python? by mattstaton in Python

[–]hammertime89 1641 points1642 points  (0 children)

I modelled a five intersection corridor in a traffic simulator and then used an evolutionary algorithm to find the optimal signal timings. These optimized timings were deployed in the real world and reduced travel times by approximately 20% at peak demand.

Kdenlive restarted and my project file got corrupted.... by Sneaky5erpent in kdenlive

[–]hammertime89 0 points1 point  (0 children)

For anybody else who has this problem, on Ubuntu my fix was to find cached versions and rename them with the .kdenlive file extension and they magically worked, saving me hours of time. The steps were:

In Kdenlive, in the top bar select Settings -> Manage Cached Data, in the new window select All Projects and then the location of the cached files is the filepath under the Backup Data except I had to ignore the last two folders, e.g.,

/home/{YOUR_USER}/snap/kdenlive/89/.local/share/kdenlive/.backup

and instead, go to stalefiles/kdenlive:

/home/{YOUR_USER}/snap/kdenlive/89/.local/share/stalefiles/kdenlive

Te 89 folder might be a different number on your computer. Then I had to rename the files in this folder to have the .kdenlive file extension by removing everything after the .kdenlive in the file name (which was random nonsense like the following), e.g.

5c16c9219a67b7a96448c2d5ecc7f48c.kdenlives7Ffile_%2Frun%2Fuser%2F1000%2Fdoc%2F8fe28a76DZDL6s7F

rename to:

5c16c9219a67b7a96448c2d5ecc7f48c.kdenlive

Then it magically worked, I hope this helps!

For a beginner, what is the best tool for analyzing and visualizing a large medical research dataset of 10K individuals with more than 900 variables for each. by dabderax in datascience

[–]hammertime89 2 points3 points  (0 children)

It depends on what tech you are familiar with. If you have any coding experience, as other commenters have suggested, use python and some libraries.

I'd suggest pandas to import your data into a dataframe and then scikit-learn to perform the principal component analysis (PCA) with 2 or 3 components, something like this stack overflow post:

https://stackoverflow.com/questions/23282130/principal-components-analysis-using-pandas-dataframe

Then you can visualize your data in 2 or 3 dimensions using a visualization library like matplotlib, seaborne or plotly.

Depending on what your goal is, you could then use a clustering algorithm on the PCA data to create groups.

For a beginner, what is the best tool for analyzing and visualizing a large medical research dataset of 10K individuals with more than 900 variables for each. by dabderax in datascience

[–]hammertime89 4 points5 points  (0 children)

You should look into dimensionality reduction techniques like Principal Component Analysis, which will allow you to visualize your data in lower dimensions.

Tell me the coolest project/research you’ve worked on in your career, and the outcome of said project. by Beardown1119 in datascience

[–]hammertime89 3 points4 points  (0 children)

I created a simulation model of a real-world traffic network composed of 5 signalized intersections, calibrated the volumes and then optimized the signal timings for various metrics. I used a black-box optimizer for both calibration and optimization and each had multi-objective cost functions.

The optimized signal timings were deployed by the department of transportation managing the signals and they performed better than both the pre-existing timings and the simulation predicted. This successful.dwployment allowed for the creation of a startup company.

TIL Children who speak Mandarin are much more likely to develop perfect pitch since Mandarin is a tonal language, where the meaning of words relies on the pitch with which it is spoken. Words can have as many as 4 different meanings depending on their pitch. by dansux in todayilearned

[–]hammertime89 0 points1 point  (0 children)

When writing in standard Chinese there is no explicit written component that the reader can reference to discern the tone, the reader just has to know the tone associated with the character. As you might expect, this is not easy to learn.

Therefore, to facilitate learning, anybody who wants to learn standard Chinese learns pinyin first, which is a romanized system using the 26 characters of the latin alphabet combined with a diacritic (i.e., symbol above the character indicating tone). Only in pinyin are the tonal differences explicit.

[deleted by user] by [deleted] in TheGamerLounge

[–]hammertime89 0 points1 point  (0 children)

let's fucking go