如何选择人工智能编程语言?

发布于 2024-08-14 07:27:43 字数 1431 浏览 5 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(12

与往事干杯 2024-08-21 07:27:43

人工智能研究中剩下的所有酷酷的大胡子专家都使用 Lisp :)

有两个大阵营:Common Lisp 和Scheme。它们有不同的语法等。为两者编写了很多好东西。

Java 是一种非常流行的通用语言,但人工智能/函数式编程中的许多有趣的东西(例如将闭包作为一阶对象传递)在 Java 中执行起来很笨拙。

我个人的偏好是远离 Windows 语言,例如 C# 和 F#。很酷的人在 Unix 下开发。或者 Linux,如果它们很酷但很差。

一些很酷但很奇怪的人用 Haskell 编程。一种相当现代的 FP 语言,具有良好的性能。我试过一次,看得我脑壳疼;但你可能比我聪明。


更新:回答史蒂夫的问题。

  1. 我不会是那个为 Unix 变体付费的人;这就是公司和研究机构所做的事情。这个想法是,你想要为一家在硬件上投入数百万美元并且不惜花费数千美元购买操作系统的公司进行人工智能研究。这种服装可能会在自助餐厅吃到美味的食物和/或因从事有趣的工作而获得丰厚的报酬。但我当然不会批评 Linux。

  2. F# 可能很酷,但我发现要让它在 Linux 或任何其他 Unix 上运行(这就是我所说的“windowsy”)上存在大量问题,而且我不想在 Windows 下工作(这就是我的意思)意思是“个人喜好”)。

  3. 详细说明“windowsy”主题:您提到 F# 是 OCaml 变体。从我自己承认的简短研究来看,F# 似乎缺少函子、OCaml 风格的对象、多态变体和 camlp4 预处理器。没有函子的函数式语言?真的吗?如果有人不喜欢微软(正如我承认的那样),人们可能会得出这样的结论:他们已经将一种完美的函数式语言 OCaml 强行塞进了他们可以在 CLR 中运行的东西,这样他们就可以声称“拥有”一种函数式语言。最后,因为我不怀疑,我知道微软总是优先考虑市场主导地位而不是产品质量,所以我不打算碰F#。但这是我个人的偏好,并且明确指出了这一点,而我们实际上更关心的是为 mary.ja45 提供良好的推荐。

我有更好的理由推荐 Lisp,而不是 F#,甚至 OCaml 和 Haskell。这些主要基于 Lisp 在人工智能领域相对于任何其他语言的历史优势。

  • 大部分人工智能文献都是基于用 Lisp 或 Prolog 编写的程序。如果不出意外,良好的 Lisp 知识将使学生能够理解示例程序。我个人最喜欢的人工智能大型项目 Cyc,可以选择 Common Lisp 或 C 来运行。

  • 在编程语言的 TIOBE 索引中(如工业中所看到和使用的),Lisp 排名第 15 位,而 Haskell 排名第 43 位,F# 和 OCaml 排名第 43 位排名低于 50 名。市场存在自然与就业机会相关。

也就是说,许多年轻的“人工智能有趣”语言很可能即将飙升。如果某个主要研究机构用 Scala 等语言发表了一些开创性的、定义该领域的研究,您会看到 Scala 在研究界的受欢迎程度急剧上升,而在工业界则有一些滞后。

我(显然)无法评论 F# 的其他品质,但欢迎您像我一样提出建议。

All the cool bearded gurus in what's left of AI research use Lisp :)

There are two big camps: Common Lisp and Scheme. They have different syntax, etc. Lots of good stuff written for both.

Java is a very popular all-purpose language but a lot of the interesting stuff in AI / Functional Programming, such as passing closures as first-order objects, is clumsy to do in Java.

My personal preference would be to stay away from Windowsy languages like C# and F#. Cool people develop under Unix. Or Linux if they're cool but poor.

Some cool but weird people program in Haskell. A reasonably modern FP language with good performance. I tried it once, it made my brain hurt; but you might be smarter than I am.


UPDATE: Answers to Steve's questions.

  1. I wouldn't be the one paying for a Unix variant; that's what corporations and research institutes do. The idea is, you want to be doing AI research for an outfit that sinks millions into their hardware and doesn't balk at paying a few thousand for an operating system. That's the kind of outfit likely to have good food in the cafeteria and/or pay well for doing fun work. But I'm certainly not knocking Linux.

  2. F# may be cool but I see a whole raft of issues getting it to run on Linux or any other Unix (that's what I meant by "windowsy"), and I don't want to work under Windows (that's what I meant by "personal preference").

  3. To elaborate on the "windowsy" theme: You mention that F# is an OCaml variant. From my own admittedly brief research, it seems that F# is missing functors, OCaml-style objects, polymorphic variants and the camlp4 preprocessor. A functional language without functors? Really? If one were disposed to not like Microsoft, as I admittedly am, one could conclude that they had gone ahead and crowbarred a perfectly good functional language, OCaml, into something they could get to run in their CLR so they could claim to "have" a functional language. Finally, because I don't suspect, I know that Microsoft always prioritizes market dominance over product quality, I don't plan to touch F#. But this is my personal preference, and clearly identified as such, while we're really more concerned with making a good recommendation for mary.ja45 .

I have better reasons to recommend Lisp over F# and even OCaml and Haskell. These are mostly based on the historic preponderance of Lisp over any other language in the AI field.

  • The bulk of AI literature is based on programs written in Lisp or Prolog. If nothing else, good knowledge of Lisp would allow a student to understand the sample programs. My personal favorite AI megaproject, Cyc, has runtimes in your choice of Common Lisp or C.

  • In the TIOBE index of programming language (as seen and used in industry), Lisp takes 15th place while Haskell takes 43rd and F# and OCaml place below 50th. Presence on the market correlates with employment opportunities, naturally.

That said, it's quite possible that a number of the younger "AI interesting" languages are poised to skyrocket. If some major research institute published some groundbreaking, defining-the-field research in, say, Scala, you'd see Scala's popularity advance sharply in the research community and, with some lag, in industry.

I (obviously) can't comment on F#'s other qualities but you're as welcome to make recommendations as I was.

回心转意 2024-08-21 07:27:43

Python 似乎在一般科学界被广泛使用。它有很多可用的库并且很容易学习。

Python seems to be used a lot in the general scientific community. It has a lot of libraries available and it's easy to learn.

荒岛晴空 2024-08-21 07:27:43

我会把Scala扔进锅里。

  • 它可用于函数式编程
  • 它可以像 Java 一样快
  • 它是一种现代语言,具有很多优点
  • Java 似乎在人工智能中也很流行,所以你可以使用 Scala 中的所有 Java 库

我已经解决了所有练习来自 Scala 基础人工智能课程。效果非常好。

I'll throw Scala into the pot.

  • it's usable for functional programming
  • it can be made as fast as Java
  • it's a modern language with lot's of nice aspects
  • Java seems to be a bit popular in AI, too and so you can use all those Java libraries from Scala

I've solved all exercises from a basic AI course in Scala. It worked really well.

烦人精 2024-08-21 07:27:43

如果“所有人工智能”也指机器学习,我想,Matlab、R 和 Python+Scipy 肯定应该被提及。

If by "all of AI" you also mean machine learning, which I guess, Matlab, R and Python+Scipy should definately be mentioned.

挽清梦 2024-08-21 07:27:43

我个人使用 Clojure 进行 AI 编程,并发现它是一种出色的全能 AI 语言。

原因:

  • 这是一个 Lisp,而且 Lisp 历来在 AI 领域非常强大。
  • 它是一个 同像具有强大宏的语言,非常适合代码生成和遗传编程。这对于 AI 编程来说是一个非常有用的属性(并且可能解释了 Lisp 在这个领域的一些成功)
  • 它在 JVM 上运行,并且可以轻松访问所有 J​​ava 库进行数字运算(Weka 、柯尔特等)。
  • 它有利于快速交互式开发 - 它非常动态,您可以在运行的 Clojure REPL 中交互式地完成几乎所有事情。无需重新编译等。

I personally use Clojure for AI programming, and have found it to be a great all-rounder AI language.

Reasons:

  • It's a Lisp, and Lisps have historically been very strong the the AI field
  • It's a homoiconic language with powerful macros, so great for code generation and genetic programming. This is a surprisingly useful property for AI programming (and possibly explains some of the success of Lisp in general in this space)
  • It runs on the JVM and can easily access all the Java libraries for number crunching (Weka, Colt, etc.).
  • It's good for rapid interactive development - it's very dynamic and you can do pretty much everything interactively in a running Clojure REPL. No need for recompiling etc.
遮云壑 2024-08-21 07:27:43

编程环境是否学术可能很重要,但对于大多数非学术人工智能应用程序开发,我建议坚持使用 Java 或 C++ 等主流语言。需要能够轻松地与其他 COTS 或开源软件交互包,而这在更“异国情调”的语言中有时会很困难或不可能。对于学术工作来说,这可能不是一个那么重要的问题。

此外,性能对于许多应用程序来说非常重要,主流语言通常具有最优化的编译器,例如 C++ 或 Java。

确实,像 LISP、Scheme 等函数式编程语言具有专门的功能,可以更容易地实现特定的 AI 方法,但我不认为这对于整个 AI 相关编程来说是正确的,例如定量机器学习方法通常不需要函数式语言。如果您需要访问函数结构和通用软件包,可以使用一些LISP 工具< /a> 来帮助解决这个问题,最近开发的 Clojure 是一个 LISP 变体,运行在 JVM 上并可以访问 Java 库。此外,Groovy 是另一种基于 JVM 的语言,支持闭包。

最后,一些程序员喜欢人工智能项目的范例灵活性和/或快速原型设计。由于这个原因,Ruby 和 Python 都被视为一些与 AI 相关的用途,它们是也可用于脚本编写的多范式语言。

与编程中的大多数事情一样,在人工智能开发中使用哪种语言的最佳答案最终取决于项目的需求。

It matters probably whether the programming environment is academic or not, but for most non-academic AI application development I would recommend sticking with a mainstream language like Java or C++. One needs to be able to interface readily with other COTS or open-source software packages, and this can sometimes be difficult or impossible in more "exotic" languages. For academic work this may be a less critical issue.

Additionally, performance can be important for many applications, and mainstream languages generally have the most heavily-optimized compilers, e.g., C++ or Java.

It is true that functional programming languages like LISP, Scheme, etc have specialized features that may make it easier to implement particular AI methods, but I do not believe this to be true for AI-related programming as a whole, e.g., quantitative machine learning methods usually don't require a functional language. If you need access to both functional constructs and general software packages, there are some tools for LISP to help with this, and the recently-developed Clojure is a LISP-variant that runs on the JVM and can access Java libraries. Also, Groovy is another JVM-based language that includes support for closures.

Lastly, some programmers like paradigm flexibility and/or fast prototyping for AI projects. Ruby and Python both see some AI-related usage for this reason as multi-paradigm languages that can also be used for scripting.

Like most things in programming, the best answer for which language to use in AI development will ultimately depend on the needs of your projects.

北笙凉宸 2024-08-21 07:27:43

这实际上取决于您正在寻找什么样的问题。另外,你想对人工智能的研究有多“深入”。如果您想从基础知识中学习并只是实现理论人工智能的东西,请使用更高级的语言 - 例如函数式编程(并在人工智能中得到证明),如 lisp 或 prolog。如果您知道要处理的问题集并且想要高效,请使用 Java、C++ 等工具并使用工具包来完成这些工作。
既然你提到了机器学习,请查看 Java 中的 Weka Toolkit 来了解其中的一些内容。

It really depends on what kind of problem you are looking at. Also, how "deep" you want to go into AI stuff. If you want to learn from the basics and just implement theoretical AI stuff, go with a higher level language-- as in functional programming (and proven in AI) like lisp, or prolog. If you know what problem set you are dealing with and want efficient, go with something like Java, C++ and use a toolkit to do the stuff.
Since you mention Machine Learning look into Weka Toolkit in Java for some of these stuff.

千寻… 2024-08-21 07:27:43

选择具有人工智能技术的编程语言,就像为任何其他项目选择语言一样:

  • 您要解决的问题是什么
    解决?
  • 是否有良好的支持
    语言?
  • 客户有什么要求?

我推荐 Prolog 作为一种非常好的编程语言,用于实现人工智能系统。

Pick the programming language with AI techniques the same way you pick a language for any other project:

  • What is the problem you are trying to
    solve?
  • Is there good support available for
    the language?
  • What are the customers requirements?

I would recommend Prolog as a very good programming language used to implement AI systems.

ぃ弥猫深巷。 2024-08-21 07:27:43

没有“最好”的语言。每一种都有其优点。当我研究 AI 时,我们主要使用 lisp 和 prolog,但我在 AI 领域使用 Java/C# 的效率最高,而 F# 可以提供很多东西。

There is no "best" language. Each one has its merits. When I studied AI, mostly we worked with lisp and prolog, but I've been most productive in AI with Java/C# and F# has a lot to offer.

韵柒 2024-08-21 07:27:43

一个用 Java 编写的框架怎么样,支持“高级逻辑”和代理风格的通信。

http://highlevellogic.blogspot.com/2010/11 /when-will-we-have-artificial.html

How about a framework written in Java, supporting "High Level Logic" and agent style communication.

http://highlevellogic.blogspot.com/2010/11/when-will-we-have-artificial.html

半世蒼涼 2024-08-21 07:27:43

它还取决于数据集的大小。对于网络规模的数据集,您可能需要使用 Map-Reduce,这意味着 Hadoop。 Hadoop 使用 Java 语言编写——但您可以使用任何语言(Python 等)来实现 Map-Reduce 函数。

It also depends on the size of your dataset. For web-scale datasets you may want to use Map-Reduce and that implies Hadoop. Hadoop is in Java -- but you could use any language (Python, etc.) for your Map-Reduce functions.

公布 2024-08-21 07:27:43

还有一个java框架叫weka,由怀卡托大学开发。我不知道它是否能回答你的问题,但它可能会有所帮助。

引用 wikipedia: «Weka 支持多种标准数据挖掘任务,更具体地说,数据挖掘预处理、聚类、分类、回归、可视化»等等。

There is also a java framework called weka, developped by the university of waikato. I don't know wether it anwsers your question, but it may help.

Quoting wikipedia: «Weka supports several standard data mining tasks, more specifically, data preprocessing, clustering, classification, regression, visualization» and more.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文