![]() |
|
![]() |
|
![]() |
|
![]() |
|
![]() |
|
![]() |
|
![]() |
|
![]() |
|
![]() |
|
![]() |
|
![]() |
|
![]() |
|
![]() |
|
![]() |
|
![]() |
|
加密货币新闻
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),我们将及时删除。
-
- 朝鲜的网络情节:通过虚拟抢劫案为武器开发提供资金
- 2025-07-01 10:30:12
- 朝鲜国民因窃取超过90万美元的虚拟货币以资助武器计划而被起诉。深入了解平壤的非法网络计划。
-
- 被低估的加密代币:计算令牌窃取节目吗?
- 2025-07-01 10:50:12
- 计算令牌正在为其在AI和分散计算中的潜力而受到关注,但是与GameFI和传统财务相比,它们仍然被低估了吗?
-
-
-
-
- Neo Pepe:这是您一直在等待的加密机会吗?
- 2025-07-01 11:10:12
- Neo Pepe成为最佳Pepe硬币的吸引力,深入其预售,令牌交易约为0.07美元。这是您一直在等待的加密机会吗?
-
- Litecoin减半和供应冲击:有什么交易?
- 2025-07-01 11:15:12
- Litecoin在减半后会出现供应冲击吗?我们分解了关键因素及其对LTC的未来意味着什么。
-
-
- 特朗普,加密和比特币采矿:一个新时代?
- 2025-07-01 11:30:12
- 探索特朗普政策的交集,加密货币市场的发展以及比特币采矿的未来。