![]() |
|
![]() |
|
![]() |
|
![]() |
|
![]() |
|
![]() |
|
![]() |
|
![]() |
|
![]() |
|
![]() |
|
![]() |
|
![]() |
|
![]() |
|
![]() |
|
![]() |
|
加密貨幣新聞文章
Solving a Rubik's Cube with Supervised Learning — Intuitively and Exhaustively Explained
2025/01/10 23:05
Solving a Rubik's Cube with Deep Learning
A step-by-step guide to building a model that can solve a Rubik's Cube
Daniel Warfield
Follow
Towards Data Science
--
Share
In this article we’ll build a deep learning model that can solve a Rubik's Cube. We’ll define our own dataset, make a transformer style model that can learn based on that dataset, and use that model to solve new and randomly shuffled Rubik's Cubes.
In tackling this problem we’ll discuss practical problems which come up frequently in data science, and the techniques data scientists use to solve those problems.
Who is this useful for? Anyone interested in achieving mastery of modern AI.
How advanced is this post? This post covers advanced modeling strategies intuitively, and is appropriate for readers of all levels.
Pre-requisites: There are no prerequisites for this article, though an understanding of transformer style models may be useful for some of the later, code heavy sections.
References: A link to the code and supporting resources can be found in the reference section at the end of this article.
Defining a Rubik's Cube as a Modeling Problem
As you likely know, the Rubik's Cube is a geometric game featuring a 3x3x3 cube with different colored squares on each of its six faces. The goal of the game is to manipulate the cube in order to return it to its original state, with each face displaying a single, uniform color.
We can define a Rubik's Cube in terms of a sequence of moves. Each move corresponds to a 90-degree rotation of one of the cube's six faces. We can represent a move using a single character, where F corresponds to a clockwise rotation of the front face, B corresponds to a clockwise rotation of the back face, L corresponds to a clockwise rotation of the left face, R corresponds to a clockwise rotation of the right face, U corresponds to a clockwise rotation of the upper face, and D corresponds to a clockwise rotation of the lower face.
For example, the sequence of moves "FRUR'D'" corresponds to a clockwise rotation of the front face, followed by a clockwise rotation of the right face, followed by a counter-clockwise rotation of the upper face, and finally followed by a counter-clockwise rotation of the lower face.
We can use this notation to define any possible state of a Rubik's Cube. For example, the starting state of a Rubik's Cube can be represented by the following sequence of moves:
```
UUUUUUUUURRRRRRRRRFFFFFFFFFDDDDDDDDDLLLLLLLLLLBBBBBBBBB
```
This sequence of moves corresponds to the following sequence of rotations:
```
U -> R -> U -> R -> U -> R -> U -> R -> U -> U -> U -> U -> U -> U -> U
```
We can apply this sequence of rotations to a scrambled Rubik's Cube in order to return it to its starting state.
We can now define the modeling problem as follows: given a scrambled Rubik's Cube, we want to predict the sequence of moves that will return the cube to its starting state.
免責聲明:info@kdj.com
所提供的資訊並非交易建議。 kDJ.com對任何基於本文提供的資訊進行的投資不承擔任何責任。加密貨幣波動性較大,建議您充分研究後謹慎投資!
如果您認為本網站使用的內容侵犯了您的版權,請立即聯絡我們(info@kdj.com),我們將及時刪除。
-
-
- 比特幣價格,羅比尼和BTC勢頭:這是怎麼回事?
- 2025-07-01 06:30:11
- 隨著Robinhood隨著令牌化股票的擴展,比特幣徘徊在107,500美元中,這表明了加密貨幣的機構和零售利益的增長。
-
- PNG會員資格飆升以記錄高:深入了解增長及其含義
- 2025-07-01 06:50:11
- PNG成員身份達到了歷史悠久的高度,標誌著該組織和錢幣社區的新時代。是什麼推動了這一增長,為什麼要關心?
-
- 比特幣的突破到$ 110K:紐約有什麼真正的交易?
- 2025-07-01 06:50:11
- 比特幣可以達到$ 110k嗎?我們分解了從通貨膨脹到標準普爾500指數的關鍵因素,並具有紐約的邊緣。
-
-
-
-
- XRP,比特幣及其感知缺陷:2025年的視角
- 2025-07-01 07:15:11
- 看看2025年的XRP和比特幣,研究了它們的優勢,劣勢以及它們如何超越最初的設計。他們仍然是對手還是互補?
-
- 比特幣價格眼睛$ 108K:上升勢頭盛行,寶貝!
- 2025-07-01 07:30:12
- 比特幣的背,寶貝!機構利益和ETF湧入可能的激增至$ 108K及以後。新的歷史最高現象嗎?讓我們深入研究比特幣嗡嗡聲!