wolfram语言入门_如何用Wolfram语言绘制猫和其他愚蠢的东西

本文是Wolfram语言的入门指南,介绍如何使用该语言创作包括绘制猫在内的各种趣味图形。通过翻译自的数据科学文章,读者可以了解到Wolfram语言在图形绘制方面的应用。
摘要由CSDN通过智能技术生成

wolfram语言入门

You can’t teach an old dog new tricks, but maybe you can teach a neural network to draw a picture of a cat? The other day, when I was perusing the always interesting Wolfram Neural Network Repository, I came across a little gem. A neural network unassumingly called Sketch-RNN claimed to be able to draw cats, dogs, trombones, windmills, and a host of other animals and objects. This, I had to try!

您不能教老狗新的花样,但也许您可以教神经网络绘制猫的照片? 前几天,当我仔细阅读总是很有趣的Wolfram神经网络存储库时,我遇到了一个小问题。 粗略地称为Sketch-RNN的神经网络声称能够绘制猫,狗,长号,风车以及许多其他动物和物体的图画。 这,我不得不尝试!

To draw a sketch, this Sketch-RNN page prompted me to copy and paste a big blob of Wolfram Language code. This worked very nicely, but I wanted to have a single function to hide all that complexity. So I wrote a simple ResourceFunction to do exactly this.

要绘制草图,此Sketch-RNN页面提示我复制并粘贴一大块Wolfram语言代码。 这工作得很好,但是我想有一个功能来掩盖所有这些复杂性。 所以我写了一个简单的ResourceFunction来做到这一点。

These resource functions are great because they are basically lumps of code that get automatically downloaded from the web:

这些资源功能很棒,因为它们基本上是从网上自动下载的大量代码:

DrawSketch = ResourceFunction[
"user:arnoudb/DeployedResources/Function/DrawSketch"
]

With this resource function, I was able to try to sketch my first animal:

通过此资源功能,我能够尝试绘制我的第一个动物:

Image for post
(image by author and artificial “intelligence”)
(作者提供的图片和人为的“智慧”)

OK, so the result is more a Picasso than a Rembrandt but obviously it is getting the essence of a cat right. Presumably, with an improved neural network and more advanced training data, this has the potential to go much further.

好的,所以结果更像是毕加索而非伦勃朗,但显然它使猫的本质变得正确。 据推测,有了改进的神经网络和更高级的训练数据,这有可能进一步发展。

All sketches have a random generation element to them, so you can sketch 25 cats and they will all look unique!

所有草图都具有随机生成元素,因此您可以绘制25只猫,它们看起来都将独一无二!

Image for post
(image by author and artificial “creativity”)
(作者提供的图片和人工“创造力”)

There are a total of 114 animals and objects you can draw with this nifty function. I decided to give them all a whirl. Many items are instantly recognizable, while some others are a bit more mysterious:

使用这个漂亮的功能,您可以绘制总共114种动物和物体。 我决定给他们一个旋转。 许多物品可以立即识别,而另一些则更加神秘:

Image for post
(image by author and our artificial “helper”)
(图片由作者和我们的人工“助手”提供)

You can have more fun with this by modifying the original DrawSketch function and adding random colors and line thicknesses to the mix. Here is one example I made with pineapples:

您可以通过修改原始的DrawSketch函数并在混合中添加随机的颜色和线条粗度来获得更多乐趣。 这是我用菠萝制作的一个示例:

Image for post
(image by author assisted by pineapples)
(作者提供图片,辅以菠萝)

The possibilities are endless here and quite fun to try them all out. I can’t see any practical application for this, except maybe inspiring preschoolers to draw certain objects by providing them lots and lots of examples to copy from. I hope you liked this silly little story and, if you’re interested in learning more about the Wolfram Language, check out my recent post titled “Learning Wolfram, Zero to Hero”. It has a great set of pointers to learning resources for this programming language! 😻🍍

这里的可能性是无穷无尽的,将它们全部尝试出来很有趣。 我看不到有任何实际的应用程序,除了可能会启发学龄前儿童通过提供大量要复制的示例来绘制某些对象来绘画它们。 我希望您喜欢这个愚蠢的小故事,并且,如果您想对Wolfram语言有更多的了解,请查阅我最近的标题为“学习Wolfram,从零到英雄”的文章。 它为该编程语言提供了大量学习资源的指针! 😻🍍

翻译自: https://towardsdatascience.com/how-to-draw-a-cat-and-other-silly-things-with-the-wolfram-language-9bf33ac7101f

wolfram语言入门

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值