TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Why Swift for TensorFlow?

212 点作者 nnd超过 6 年前

26 条评论

3jckd超过 6 年前
It&#x27;s interesting how it&#x27;s going to play out. On one hand side, Swift is a pleasant language to work with (despite its infancy). But on the other, having a Tensorflow API doesn&#x27;t suddenly give it a bunch of libraries for statistics, comp. vision, modeling, visualisation, etc. that Python&#x2F;R&#x2F;Julia <i>cough</i>MATLAB<i>cough</i> have.<p>Nowadays, it&#x27;s difficult enough to convince people to drop e.g. MATLAB for R or Python for Julia (let&#x27;s assume that there&#x27;s some merit to it), despite them having excellent counterparts for almost everything. Swift&#x27;s success in this domain depends solely on the adoption by developers&#x2F;researchers&#x2F;engineers. Unless they&#x27;re just going to mostly use it internally (as Google is known to).<p>Which brings me to the last point - why on Earth would they pick Swift (apart from Christ Lattner being involved) when Julia was on the table? It ticks all their boxes and has more mature ecosystem for all things &quot;data&quot;. Provided rationale is hardly convincing.
评论 #19130396 未加载
评论 #19130554 未加载
评论 #19131550 未加载
评论 #19130391 未加载
评论 #19133743 未加载
评论 #19130661 未加载
评论 #19131629 未加载
评论 #19130542 未加载
评论 #19130898 未加载
elpakal超过 6 年前
I also wonder how much of this coincidentally lines up with Chris Lattner landing at Google. As Chris will admit, and as was left out of this analysis, Swift has also been given the humble goal of achieving world domination. All joking aside I&#x27;m very thrilled about this and have enjoyed tremendously watching the Swift language mature since its launch due in large part to the open source community and the Swift team&#x27;s admirable commitment. Onward!
评论 #19130084 未加载
评论 #19131342 未加载
评论 #19131766 未加载
评论 #19130456 未加载
tanilama超过 6 年前
Fail to see the point of this project.<p>Swift for Tensorflow might work if the scope is to create a client side model definition loader natively for various TF models.<p>Nobody use Swift seriously for server side training, there is no point in doing so except to add swift to the list of language that claim to do deep learning but in reality nobody will consider them.
kodablah超过 6 年前
Strange to see a requirement for choosing one language over another is supposed ease of adoption and then they choose the one not easily adopted across every platform. That easy to write syntax takes precedence over general easy to write&#x2F;run is unfortunate.
igotsideas超过 6 年前
Well written explanation! I really enjoy Swift but it&#x27;s not as accessible as some of the other languages mentioned. I have a 2011 Macbook Pro and wanted to use the latest and greatest new Swift features. Unfortunately, my machine is too old to upgrade to Mojave which means I can&#x27;t download the latest version of xcode, which means no new version of Swift. I&#x27;m not mad at Apple in the least bit. I just wish I could use Swift 4 on my machine.
评论 #19130271 未加载
评论 #19130107 未加载
评论 #19130082 未加载
评论 #19130099 未加载
评论 #19130088 未加载
byt143超过 6 年前
Julia would have been a much better and more cost effective choice in my opinion.<p>It&#x27;s a superior platform to on which develop this sort of thing, and further along at that. Also easier to use.
评论 #19138593 未加载
m0zg超过 6 年前
Is there a &quot;standard&quot; way of running Swift on Ubuntu LTS nowadays? A while back I looked into it, and ran into some hokey and unsatisfying solutions. I used Swift on iOS, and I like it a lot, but if they care about adoption, someone needs to reduce friction of getting up and running to approximately zero. A snap package a-la Go or per-user script based installation a-la Rust would be quite OK, as long as it&#x27;s just one, easy to discover command.
评论 #19130495 未加载
gthippo超过 6 年前
Swift is also now supported in Colab (Google-hosted Jupyter notebooks) and there&#x27;s a nice tutorial on some of the features of Swift for Tensorflow at <a href="https:&#x2F;&#x2F;colab.research.google.com&#x2F;github&#x2F;tensorflow&#x2F;swift-tutorials&#x2F;blob&#x2F;master&#x2F;iris&#x2F;swift_tensorflow_tutorial.ipynb" rel="nofollow">https:&#x2F;&#x2F;colab.research.google.com&#x2F;github&#x2F;tensorflow&#x2F;swift-tu...</a>
sjwright超过 6 年前
I have no idea what TensorFlow is (other than the basics) but I enjoyed reading that entire document because it did such a wonderful job of explaining a complex and potentially contentious decision. It’s fascinating to see Swift feature so strongly in a pragmatic analysis that doesn’t explicitly favour Apple platform interop.
评论 #19130296 未加载
tylerwhipple超过 6 年前
I am surprised Dart is not mentioned at all (maybe implied under the OOP languages?). While Flutter and Tensorflow are very different usecases, I am surprised there is nothing in the document on why Dart specifically would be a good choice. I believe if they used Dart for Tensorflow as well, the community would be able to get behind the idea that will not be an abandoned language.
mamcx超过 6 年前
I vaguely know tensor flow as the most(?) popular lib of his kind, but I wonder how is the history of swift on non-apple platforms and its impact of the actual users.<p>Is TensorFlow &quot;huge&quot; in linux, windows, android? Because I also evaluate swift for my use case (<a href="https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;swift&#x2F;comments&#x2F;8zb9y1&#x2F;state_of_swift_for_androidlinuxwindows_on_2018&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;swift&#x2F;comments&#x2F;8zb9y1&#x2F;state_of_swif...</a>) and decide instead on use rust mainly because the lack of solid support on non-apple platforms. However, after use rust for months now I still consider swift a better contender between performance&#x2F;ergonomics than rust (rust is damm hard sometimes, and suddenly you could hit a trouble with above-average complications. I don&#x27;t see how put this burden in a library to be used for more &quot;regular&quot; folks could work)
评论 #19134241 未加载
solidsnack9000超过 6 年前
Setting aside for a moment the appropriateness of Swift for TensorFlow, this is a very impressive example of using an embedded DSL to work with a component that is a full programming system in its own right.<p>On the one hand, we do want full access to the programming model exposed by the component -- its control structures, abstractions, everything else. One the other hand, these are mostly duplicated by our host programming language: it&#x27;s going to have variable bindings, operators, iteration, conditionals and everything else. Doing an embedding like this is a way to expose most of the component&#x27;s facilities without introducing a ton of &quot;new syntax&quot; in the form of combinators or having programs where a lot of the critical code is escaped in strings.<p>This same problem shows up in programming interfaces to RDBMSes. LINQ is a good example of the same embedding technique.
victor106超过 6 年前
You might agree&#x2F;disagree with their decision but this is one of the most honest and comprehensive evaluation for using a language I&#x27;ve read.
skwb超过 6 年前
Forgive me for my ignorance, but does swift have any good plotting and interactive &quot;notebook&quot; ability? Specifically the ability to plot images such as matplotlib.<p>I ask this because the number 1 reason my deep learning research group chose python was because of the extensive and interactive scientific plotting ability that&#x27;s built into python jupyter notebooks. While our volume of analysis isn&#x27;t on the scale of say a google&#x2F;fb (primarily biomedical image analysis), the ability to easily visually debug the results is much more important for developing robust models.
评论 #19130304 未加载
评论 #19130526 未加载
moocowtruck超过 6 年前
why? because i made the language, thats why...no real good reason
评论 #19132494 未加载
lovasoa超过 6 年前
Reading the document really gives a feeling the author is not being honest on why they chose Swift.<p>The lack of windows support is addressed in just two lines. Julia being an already established language in the domain of data science does not seem to be especially important to them.<p>I think the most honest part of the document is:<p>&gt; because we were more familiar with its [Swift&#x27;s] internal implementation details
sometimesijust超过 6 年前
<a href="https:&#x2F;&#x2F;github.com&#x2F;malmaud&#x2F;TensorFlow.jl&#x2F;blob&#x2F;master&#x2F;docs&#x2F;src&#x2F;why_julia.md" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;malmaud&#x2F;TensorFlow.jl&#x2F;blob&#x2F;master&#x2F;docs&#x2F;sr...</a>
mikkelam超过 6 年前
As as python machine learning practitioner and previous iOS engineer I have for while come to miss using swift and type safety for that matter. I really like the language and wish great success for the TF team with swift.<p>Side note, does anyone know the effort required to get various python based libraries running on swift? i.e. numpy, scipy, pandas and so on?
评论 #19135374 未加载
adamnemecek超过 6 年前
I can imagine swift really taking off in this space. It’s going to be a battle between Julia and Swift for who does the best automatic differentiation.
评论 #19130171 未加载
评论 #19130260 未加载
评论 #19130513 未加载
midgetjones超过 6 年前
I wonder what this means for iOS apps themselves
评论 #19134282 未加载
masha_sb超过 6 年前
I&#x27;ll wait for the PyTorch version.
ramoz超过 6 年前
Is there an official release roadmap?
评论 #19134258 未加载
xiaodai超过 6 年前
Haven&#x27;t we seen this before?
评论 #19134303 未加载
hooloovoo_zoo超过 6 年前
<a href="https:&#x2F;&#x2F;xkcd.com&#x2F;927&#x2F;" rel="nofollow">https:&#x2F;&#x2F;xkcd.com&#x2F;927&#x2F;</a>
评论 #19130592 未加载
aaaaaaaaaaab超过 6 年前
Why not Rust?<p>Edit: I wonder if Swift could be replaced with Rust for iOS development?
评论 #19130225 未加载
评论 #19132847 未加载
评论 #19136245 未加载
评论 #19130807 未加载
评论 #19130220 未加载
5stospace超过 6 年前
I still don&#x27;t understand why they would choose Swift over C#?<p>They complain about C#&#x2F;Java having &quot;highly dynamic constructs&quot; but correct me if I&#x27;m wrong but isn&#x27;t swift also a GC&#x2F;OOP like Java and C#?<p>I don&#x27;t think Swift has any inherent objective advantages over c#.<p>I think it would have been a better decision to go with C# over Swift as Microsoft has a clear roadmap with the language and it is already supported on linux&#x2F;mac&#x2F;windows.
评论 #19132508 未加载
评论 #19131700 未加载