(转载)最近学Deep Learning感觉chatgpt写code太爽了,码工可以进历史垃圾堆了
版主: hci
#1 (转载)最近学Deep Learning感觉chatgpt写code太爽了,码工可以进历史垃圾堆了
此帖转自 LittleBear 在 军事天地(Military) 的帖子:最近学Deep Learning感觉chatgpt写code太爽了,码工可以进历史垃圾堆了
1,无论你希望要什么样的神经网络,只需要大致跟chatgpt说一下,马上就可以写出来
2,然后在jupyter notebook上调试,通不过就把error message发给chatgpt,立马就告诉你哪里错了。
3,接着让chatgpt写个新版本,立马就完成了。
4,再把新版本黏贴到jupyter notebook里面,很快就调试好了。
码工真的可以进历史的垃圾堆了。呵呵
1,无论你希望要什么样的神经网络,只需要大致跟chatgpt说一下,马上就可以写出来
2,然后在jupyter notebook上调试,通不过就把error message发给chatgpt,立马就告诉你哪里错了。
3,接着让chatgpt写个新版本,立马就完成了。
4,再把新版本黏贴到jupyter notebook里面,很快就调试好了。
码工真的可以进历史的垃圾堆了。呵呵
#2 Re: (转载)最近学Deep Learning感觉chatgpt写code太爽了,码工可以进历史垃圾堆了
好吧,让chatgpt写个火箭分级推动点火程序吧。
There are two ways to conquer and enslave a country. One is by the sword. The other is by debt. - John Adams
#3 Re: (转载)最近学Deep Learning感觉chatgpt写code太爽了,码工可以进历史垃圾堆了
GPT是个好的学习工具。同意。
用来干活,也有帮助,不用什么都自己写,提高生产力。同意。
GPT取代码工。不可能。
其实有了GPT,高级码工更高级了。GPT堵住了很多本来可以变成高级码工的人的路,他们永远也成不了高级码工了,因为缺乏经验。
用来干活,也有帮助,不用什么都自己写,提高生产力。同意。
GPT取代码工。不可能。
其实有了GPT,高级码工更高级了。GPT堵住了很多本来可以变成高级码工的人的路,他们永远也成不了高级码工了,因为缺乏经验。
x2

#4 Re: (转载)最近学Deep Learning感觉chatgpt写code太爽了,码工可以进历史垃圾堆了
说得不错,就像人人都知道质能方程e=mc2,但要想实际造出原子弹,几乎就已经过滤掉99%的人了,因为实际过程会遇到什么难题,走过的人不会轻易告诉你(就是告诉你,真假主次也是一个问题...你要get it还是要实操),很多事情,你不亲自走一趟,连问题都提不出来,这就是经验的重要性。hci 写了: 2024年 9月 26日 20:33 GPT是个好的学习工具。同意。
用来干活,也有帮助,不用什么都自己写,提高生产力。同意。
GPT取代码工。不可能。
其实有了GPT,高级码工更高级了。GPT堵住了很多本来可以变成高级码工的人的路,他们永远也成不了高级码工了,因为缺乏经验。
当然,并不是任何人都想自己造原子弹,都想去当高级马工创造点什么,平平淡淡一份普通工作也挺好。
想起来三国演义里面许多著名的索南不是老说一句话:大丈夫碌碌无为,与草木何异!
-
- 论坛支柱
VladPutin 的博客 - 帖子互动: 1584
- 帖子: 13758
- 注册时间: 2022年 7月 24日 11:12
#6 Re: (转载)最近学Deep Learning感觉chatgpt写code太爽了,码工可以进历史垃圾堆了
你的意思是只要不是专用软件都可以用chatgpt写?这不就是说世上99%的程序猿都要失业了。
蒙古国有愚豕浮阳外越,便结不通,频下清个痢虚之气。虽屡试开赛露之剂,终无寸效。遂引诣兽医师诊之。医者摩其腹良久,谓主人曰:"咄!此蠢物腹中空若悬磬,纵投万斛通肠开赛之剂,犹决涸泽而求鲋也,岂有济哉?"
#7 Re: (转载)最近学Deep Learning感觉chatgpt写code太爽了,码工可以进历史垃圾堆了
那你来找个例子,哪个非专用软件可以让chatgtp来写
There are two ways to conquer and enslave a country. One is by the sword. The other is by debt. - John Adams
#8 Re: (转载)最近学Deep Learning感觉chatgpt写code太爽了,码工可以进历史垃圾堆了
最近用GitHub copilot和cursor ai,他们比ChatGPT好很多,也就是写一些小段子,然后我看一下,多数微调一下。
省了一些时间和手写。以后不知道,因为以前也想不到现在可以这么好。
省了一些时间和手写。以后不知道,因为以前也想不到现在可以这么好。
#9 Re: (转载)最近学Deep Learning感觉chatgpt写code太爽了,码工可以进历史垃圾堆了
ChatGPT或者衍生的工具,目前能够省的是我google加初步整理的时间,搞来的code,还得re-engineering才能初步够用,离完全取代程序员还差着十多个李奇微
#10 Re: (转载)最近学Deep Learning感觉chatgpt写code太爽了,码工可以进历史垃圾堆了
尼玛,让GPT写了个很简单的小函数,很简单,所以没仔细看它到底写的是啥,结果有一个隐藏的bug,害得我花了半天时间debug,操。
我: Write a clojure function `some-indexed` so it is similar to `some` but return `[result index]`
gpt-4o: Certainly! In Clojure, the some function takes a predicate and a collection, returning the first truthy value for which the predicate returns a truthy value. To create a function some-indexed that behaves similarly but also returns the index of the value, we can use map-indexed to pair each element with its index, and then use some to find the first matching pair.
Here's how you can implement some-indexed:
(defn some-indexed
[pred coll]
(some (fn [[idx val]]
(when (pred val)
[val idx]))
(map-indexed vector coll)))
Explanation:
map-indexed is used to create a sequence of pairs [index element] from the collection.
some is used to find the first pair where the predicate applied to the element is truthy.
The anonymous function (fn [[idx val]] ...) destructures each pair into idx and val, applies the predicate to val, and if the predicate returns truthy, it returns [val idx].
Example Usage:
(some-indexed odd? [2 4 6 7 8])
;; => [7 3]
In this example, some-indexed returns [7 3] because 7 is the first odd number in the collection, and its index is 3.
我: This realize intermediate collection, write a more efficent one.
gpt-4o: Sure, to avoid realizing an intermediate collection, we can iterate through the collection manually while keeping track of the index. Here's a more efficient implementation:
(defn some-indexed
[pred coll]
(loop [idx 0, s coll]
(if (seq s)
(let [val (first s)]
(if (pred val)
[val idx]
(recur (inc idx) (rest s))))
nil)))
Explanation:
We use loop to iterate over the collection coll with an index idx starting at 0.
Within the loop, we check if the sequence s is non-empty using seq.
If the sequence is non-empty, we get the first element val.
We apply the predicate pred to val. If it returns truthy, we return [val idx].
If the predicate does not return truthy, we recursively call recur with the incremented index and the rest of the sequence.
If the sequence s is empty (nil), we return nil.
Example Usage:
(some-indexed odd? [2 4 6 7 8])
;; => [7 3]
This implementation avoids realizing intermediate collections by processing elements one at a time and directly checking the predicate.
我于是就用了这个代码。大家能看出bug在什么地方么?
我: Write a clojure function `some-indexed` so it is similar to `some` but return `[result index]`
gpt-4o: Certainly! In Clojure, the some function takes a predicate and a collection, returning the first truthy value for which the predicate returns a truthy value. To create a function some-indexed that behaves similarly but also returns the index of the value, we can use map-indexed to pair each element with its index, and then use some to find the first matching pair.
Here's how you can implement some-indexed:
(defn some-indexed
[pred coll]
(some (fn [[idx val]]
(when (pred val)
[val idx]))
(map-indexed vector coll)))
Explanation:
map-indexed is used to create a sequence of pairs [index element] from the collection.
some is used to find the first pair where the predicate applied to the element is truthy.
The anonymous function (fn [[idx val]] ...) destructures each pair into idx and val, applies the predicate to val, and if the predicate returns truthy, it returns [val idx].
Example Usage:
(some-indexed odd? [2 4 6 7 8])
;; => [7 3]
In this example, some-indexed returns [7 3] because 7 is the first odd number in the collection, and its index is 3.
我: This realize intermediate collection, write a more efficent one.
gpt-4o: Sure, to avoid realizing an intermediate collection, we can iterate through the collection manually while keeping track of the index. Here's a more efficient implementation:
(defn some-indexed
[pred coll]
(loop [idx 0, s coll]
(if (seq s)
(let [val (first s)]
(if (pred val)
[val idx]
(recur (inc idx) (rest s))))
nil)))
Explanation:
We use loop to iterate over the collection coll with an index idx starting at 0.
Within the loop, we check if the sequence s is non-empty using seq.
If the sequence is non-empty, we get the first element val.
We apply the predicate pred to val. If it returns truthy, we return [val idx].
If the predicate does not return truthy, we recursively call recur with the incremented index and the rest of the sequence.
If the sequence s is empty (nil), we return nil.
Example Usage:
(some-indexed odd? [2 4 6 7 8])
;; => [7 3]
This implementation avoids realizing intermediate collections by processing elements one at a time and directly checking the predicate.
我于是就用了这个代码。大家能看出bug在什么地方么?
上次由 hci 在 2024年 10月 3日 12:48 修改。
原因: 未提供修改原因
原因: 未提供修改原因