bitcoin
bitcoin

$94772.663446 USD

2.92%

ethereum
ethereum

$3268.497484 USD

1.77%

tether
tether

$1.000004 USD

0.01%

xrp
xrp

$2.350518 USD

3.67%

bnb
bnb

$693.546484 USD

1.55%

solana
solana

$188.683591 USD

1.88%

dogecoin
dogecoin

$0.334013 USD

5.25%

usd-coin
usd-coin

$1.000022 USD

0.01%

cardano
cardano

$0.933730 USD

4.16%

tron
tron

$0.244299 USD

2.29%

sui
sui

$5.199126 USD

10.91%

avalanche
avalanche

$36.799482 USD

2.04%

toncoin
toncoin

$5.368266 USD

3.99%

chainlink
chainlink

$20.360988 USD

4.18%

shiba-inu
shiba-inu

$0.000022 USD

3.08%

加密货币新闻

用监督学习解决魔方问题——直观而详尽的解释

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.

在本文中,我们将构建一个可以解决魔方问题的深度学习模型。我们将定义自己的数据集,制作一个可以基于该数据集学习的 Transformer 风格模型,并使用该模型来解决新的随机洗牌的魔方问题。

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.

先决条件:本文没有任何先决条件,尽管了解 Transformer 样式模型可能对后面的一些代码密集部分有用。

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.

您可能知道,魔方是一种几何游戏,其特点是 3x3x3 的立方体,其六个面上各有不同颜色的方块。游戏的目标是操纵立方体,使其恢复到原始状态,每个面都显示单一、统一的颜色。

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.

我们可以根据一系列动作来定义魔方。每一次移动都对应于立方体六个面之一的 90 度旋转。我们可以用单个字符来表示一次移动,其中F对应正面顺时针旋转,B对应背面顺时针旋转,L对应左面顺时针旋转,R对应左面顺时针旋转右面的U对应于上表面的顺时针旋转,D对应于下表面的顺时针旋转。

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.

例如,动作顺序“FRUR'D'”对应于正面顺时针旋转,右面顺时针旋转,上面逆时针旋转,最后是正面旋转。下表面逆时针旋转。

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

UUUUUUUUURRRRRRRRRFFFFFFFFDDDDDDDDDLLLLLLLLLLBBBBBBBBBB

```

````

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

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.

我们现在可以将建模问题定义如下:给定一个打乱的魔方,我们想要预测将魔方返回到其起始状态的移动顺序。

新闻来源:towardsdatascience.com

免责声明:info@kdj.com

The information provided is not trading advice. kdj.com does not assume any responsibility for any investments made based on the information provided in this article. Cryptocurrencies are highly volatile and it is highly recommended that you invest with caution after thorough research!

If you believe that the content used on this website infringes your copyright, please contact us immediately (info@kdj.com) and we will delete it promptly.

2025年01月11日 发表的其他文章