High Roller Timelapse
Sunset timelapse of the 550 foot Ferris Wheel at The Linq in Las Vegas, Nevada (technically the High Roller Observation Wheel).
Related Posts
- Sunset #11
- Timelapse, Week of Jan 31 2022
- Milky Way Rises over South Lake Tahoe
- Sunset #8
- West Portal 360
(Published to the Fediverse as: High Roller Timelapse #timelapse #video A sunset timelapse of the Ferris Wheel at The Linq in Las Vegas, Nevada (the High Roller Observation Wheel). )
Autumnal Equinox 2018
It's Autumn for the Northern Hemisphere and Spring south of the equator.
Rendered in Catfood Earth.
(Previously, Previously, Previously, Previously, Previously)
Related Posts
Better related posts with word2vec (C#)
I have been experimenting with word2vec recently. Word2vec trains a neural network to guess which word is likely to appear given the context of the surrounding words. The result is a vector representation of each word in the trained vocabulary with some amazing properties (the canonical example is king - man + woman = queen). You can also find similar words by looking at cosine distance - words that are close in meaning have vectors that are close in orientation.
This sounds like it should work well for finding related posts. Spoiler alert: it does!
My old system listed posts with similar tags. This worked reasonably well, but it depended on me remembering to add enough tags to each post and a lot of the time it really just listed a few recent posts that were loosely related. The new system (live now) does a much better job which should be helpful to visitors and is likely to help with SEO as well.
I don't have a full implementation to share as it's reasonably tightly coupled to my custom CMS but here is a code snippet which should be enough to get this up and running anywhere:
// load word2vec model | |
_vocabulary = new Word2VecBinaryReader().Read(HostingEnvironment.MapPath("~/App_Data/GoogleNews-vectors-negative300-SLIM.bin")); | |
// ... collect all words in post (words is List<string>, not included as implementation specific) ... | |
double[] vector = new double[_vocabulary.VectorDimensionsCount]; | |
// add all words that exist in the vocabulary | |
int inVocabularyCount = 0; | |
foreach(string word in words) | |
{ | |
try | |
{ | |
float[] wordVector = _vocabulary.GetRepresentationFor(word).NumericVector; | |
for (int i = 0; i < _vocabulary.VectorDimensionsCount; i++) | |
{ | |
vector[i] += (double)wordVector[i]; | |
} | |
inVocabularyCount++; | |
} | |
catch | |
{ | |
// ignore anything not in vocabulary | |
} | |
} | |
// return the average of the vectors | |
for (int i = 0; i < _vocabulary.VectorDimensionsCount; i++) | |
{ | |
vector[i] /= inVocabularyCount; | |
} | |
return vector; | |
// ... once all posts have a vector we just find the closest ones, compare this post to others and sort the list by distance ... | |
double d = Distance.Cosine(vectorThisPost, vectorOtherPost); |
The first step is getting a vector representation of a post. Word2vec just gives you a vector for a word (or short phrase depending on how the model is trained). A related technology, doc2vec, adds the document to the vector. This could be useful but isn't really what I needed here (i.e. I could solve my forgetfulness around adding tags by training a model to suggest them for me - might be a good project for another day). I ended up using a pre-trained model and then averaging together the vectors for each word. This paper (PDF) suggests that this isn't too crazy.
For the model I used word2vec-slim which condenses the Google News model down from 3 million words to 300k. This is because my blog runs on a very modest EC2 instance and a multi-gigabyte model might kill it. I load the model into Word2vec.Tools (available via NuGet) and then just get the word vectors (GetRepresentationFor(...).NumericVector) and average them together.
I haven't included code to build the word list but I just took every word from the post, title, meta description and tag list, removed stop words (the, and, etc) and converted to lower case.
Now that each post has a vector representation it's easy to compute the most related posts. For a given post compute the cosine distance between the post vector and every other post. Sort the list in ascending order and pick however many you want from the top (the distance between the post and itself would be 1, a totally unrelated post would be 0). The last line in the code sample shows this comparison for one post pair using Accord.Math, also on Nuget.
I'm really happy with the results. This was a fast implementation and a huge improvement over tag based related posts.
Updated 2023-01-29 22:00:
I have recently moved this functionality to use an OpenAI embeddings API integration.
Related Posts
- Upgrading from word2vec to OpenAI
- Predicting when fog will flow through the Golden Gate using ML.NET
- Migrating from Blogger to BlogEngine.NET
- Geotagging posts in BlogEngine.NET
- How to get SEO credit for Facebook Comments (the missing manual)
(Published to the Fediverse as: Better related posts with word2vec (C#) #code #software #word2vec #ithcwy #ml How to use word2vec to create a vector representation of a blog post and then use the cosine distance between posts to select improved related posts. )
Lassen Star Trails
A timelapse two ways shot from the Manzanita Lake campground at Lassen Volcanic National Park (the second time I've visited and the second time that Bumpass Hell has been closed). First a regular 4K timelapse looking up from the campsite:
The second version is the same footage in HD where each frame is the cumulative maximum pixel value of all the frames up to the current frame (so it builds in star trails as the video runs):
Related Posts
- Storm builds over Lassen Peak (Timelapse)
- Stars over Columbia State Historic Park
- Milky Way Rises over South Lake Tahoe
- Time Lapse of the Milky Way over Lake Shasta
- Bumpass Hell
(Published to the Fediverse as: Lassen Star Trails #timelapse #video #4k #lassen #stars Cumulative star trails and a regular night timelapse shot from the Manzanita Lake campground at Lassen Volcanic National Park in California. )
Draw the rest of the Hummingbird
A genetic algorithm learns to draw a hummingbird:
The video is an animation of three thousand generations of evolution. It starts with a random mix of line segments which are then mutated by adding or removing lines and by changing the start, end and color of existing lines. Each generation has 32 individuals. The best individual is mutated to create the next generation.
For this implementation the best or fittest individual is the one with the least error on a pixel by pixel comparison to a stock art drawing of a hummingbird. Because I care more about the shape than completely filling in the drawing an error outside the figure is penalized three times more than a gap inside the figure.
Color is mutated each generation but not selected for, so it's just changing randomly.
Related Posts
- Hummingbird 2
- Hummingbird
- Game of Death
- Space Journey
- A black lab chases a Roomba and then things start to get weird...
(Published to the Fediverse as: Draw the rest of the Hummingbird #etc #video #genetic #hummingbird Animation of three thousand generations of a generic algorithm learning how to draw a hummingbird. )
Book reviews for July 2018
Related Posts
Hoylake Beach
Timelapse looking over Hoylake beach in the Wirral, UK.
Related Posts
(Published to the Fediverse as: Hoylake Beach #timelapse #video #hoylake Timelapse of Hoylake Beach in the Wirral, United Kingdom. )
What if the Senate Voted Proportionally to Population
This is massively less likely than sorting out the Electoral College, but imagine for a minute that 100 Senators woke up tomorrow and decided to do the right thing.
Dianne Feinstein, the senior Senator from California would wield 6.04 votes. Mike Enzi, the senior Senator from Wyoming would have to make do with 0.09 votes.
Overall a party line vote would see 55.85 Democratic votes to 44.15 Republican, assuming normal independent caucusing habits. Not quite a supermajority, but enough to not send Kavanaugh to The Supreme Court for instance.
This is based on 2010 census figures from Wikipedia.
Not going to happen, but find my estimate of your State's fair voting power by Senator below.
State | Votes per Senator |
---|---|
California | 6.04 |
Texas | 4.08 |
Florida | 3.05 |
New York | 3.14 |
Pennsylvania | 2.06 |
Illinois | 2.08 |
Ohio | 1.87 |
Georgia | 1.57 |
North Carolina | 1.55 |
Michigan | 1.6 |
New Jersey | 1.43 |
Virginia | 1.3 |
Washington | 1.09 |
Arizona | 1.04 |
Massachusetts | 1.06 |
Tennessee | 1.03 |
Indiana | 1.05 |
Missouri | 0.97 |
Maryland | 0.94 |
Wisconsin | 0.92 |
Colorado | 0.82 |
Minnesota | 0.86 |
South Carolina | 0.75 |
Alabama | 0.78 |
Louisiana | 0.74 |
Kentucky | 0.7 |
Oregon | 0.62 |
Oklahoma | 0.61 |
Connecticut | 0.58 |
Iowa | 0.49 |
Utah | 0.45 |
Arkansas | 0.47 |
Nevada | 0.44 |
Mississippi | 0.48 |
Kansas | 0.46 |
New Mexico | 0.33 |
Nebraska | 0.3 |
West Virginia | 0.3 |
Idaho | 0.25 |
Hawaii | 0.22 |
New Hampshire | 0.21 |
Maine | 0.22 |
Rhode Island | 0.17 |
Montana | 0.16 |
Delaware | 0.15 |
South Dakota | 0.13 |
North Dakota | 0.11 |
Alaska | 0.12 |
Vermont | 0.1 |
Wyoming | 0.09 |
Related Posts
- End the Electoral College: Amendment, Compact, or Supreme Court?
- Liquid Democracy and united.vote
- Age and Life Expectancy Weighted Voting
- 2020 Results
- Legislative Service
(Published to the Fediverse as: What if the Senate Voted Proportionally to Population #politics #senate #electoralcollege #politicalreform Dianne Feinstein would get 6.04 votes in CA and Mike Enzi 0.09 in WY if the Senate voted based on population. Based on 2010 Wikipedia census figures. )
Moorhen and Chick
Moorhen and her chick at the village pond in Mapledurwell, Hampshire, UK.
The photograph titled "Moorhen and Chick" captures a tender moment between a moorhen and its young chick, hidden within the shaded embrace of verdant foliage. The adult moorhen, with its deep, dark plumage, bends gracefully towards the small, fuzzy chick, creating a gentle narrative of care and nurturing. The chick, a tiny bundle of downy feathers, eagerly leans towards the adult’s vibrant red and yellow beak. A soft, dappled play of light and shadows bathes the scene, with hints of green leaves framing the interaction, adding a lush backdrop that accentuates the intimacy of this wildlife vignette.
In terms of composition, the photographer has employed a natural framing technique using the surrounding leaves, enhancing the focus on the bond between the moorhen and its chick. The use of chiaroscuro—contrasting light and shadows—adds depth and a sense of privacy to the scene, drawing the viewer into the intimate encounter. The placement of the subjects within the lower half of the image grounds the composition, giving it stability and balance. However, the low light and shadowy setting might obscure some of the more delicate details, reducing the visual clarity of the subjects. Despite this, the photograph beautifully conveys emotion and connection, which is its strongest artistic merit, inviting viewers into a quiet, yet poignant moment in nature.
Related Posts
(Published to the Fediverse as: Moorhen and Chick #photo #moorhen Photo of a Moorhen and her chick shot at the village pond in Mapledurwell, Hampshire, United Kingdom. )