DL之RNN:人工智能为你写代码——基于TF利用RNN算法实现生成编程语言代码(C++语言)、训练&测试过程全记录(二)

简介: DL之RNN:人工智能为你写代码——基于TF利用RNN算法实现生成编程语言代码(C++语言)、训练&测试过程全记录

训练&测试过程全记录


1、训练过程


2018-10-13 18:47:32.811423:

step: 10/20000...  loss: 3.7245...  0.4903 sec/batch

step: 20/20000...  loss: 3.6450...  0.4442 sec/batch

step: 30/20000...  loss: 3.8607...  0.4482 sec/batch

step: 40/20000...  loss: 3.5700...  0.4993 sec/batch

step: 50/20000...  loss: 3.5019...  0.5444 sec/batch

step: 60/20000...  loss: 3.4688...  0.4512 sec/batch

step: 70/20000...  loss: 3.3954...  0.5244 sec/batch

step: 80/20000...  loss: 3.3532...  0.4031 sec/batch

step: 90/20000...  loss: 3.2842...  0.6517 sec/batch

step: 100/20000...  loss: 3.1934...  0.4893 sec/batch

……

step: 990/20000...  loss: 2.0868...  0.4111 sec/batch

step: 1000/20000...  loss: 2.0786...  0.4001 sec/batch

step: 1010/20000...  loss: 2.0844...  0.4352 sec/batch

step: 1020/20000...  loss: 2.1136...  0.4402 sec/batch

step: 1030/20000...  loss: 2.1023...  0.3199 sec/batch

step: 1040/20000...  loss: 2.0460...  0.4522 sec/batch

step: 1050/20000...  loss: 2.1545...  0.4432 sec/batch

step: 1060/20000...  loss: 2.1058...  0.3680 sec/batch

step: 1070/20000...  loss: 2.0850...  0.4201 sec/batch

step: 1080/20000...  loss: 2.0811...  0.4682 sec/batch

step: 1090/20000...  loss: 2.0438...  0.4301 sec/batch

step: 1100/20000...  loss: 2.0640...  0.4462 sec/batch

……

step: 1990/20000...  loss: 1.9070...  0.4442 sec/batch

step: 2000/20000...  loss: 1.8854...  0.3920 sec/batch

……

step: 4000/20000...  loss: 1.7408...  0.4612 sec/batch

step: 4010/20000...  loss: 1.8354...  0.4402 sec/batch

step: 4020/20000...  loss: 1.8101...  0.3951 sec/batch

step: 4030/20000...  loss: 1.8578...  0.4422 sec/batch

step: 4040/20000...  loss: 1.7468...  0.3770 sec/batch

step: 4050/20000...  loss: 1.8008...  0.4301 sec/batch

step: 4060/20000...  loss: 1.9093...  0.3650 sec/batch

step: 4070/20000...  loss: 1.8889...  0.4582 sec/batch

step: 4080/20000...  loss: 1.8673...  0.4682 sec/batch

step: 4090/20000...  loss: 1.7999...  0.3951 sec/batch

step: 4100/20000...  loss: 1.7484...  0.4582 sec/batch

step: 4110/20000...  loss: 1.7629...  0.4071 sec/batch

step: 4120/20000...  loss: 1.6727...  0.3940 sec/batch

step: 4130/20000...  loss: 1.7895...  0.3750 sec/batch

step: 4140/20000...  loss: 1.8002...  0.3860 sec/batch

step: 4150/20000...  loss: 1.7922...  0.4532 sec/batch

step: 4160/20000...  loss: 1.7259...  0.3951 sec/batch

step: 4170/20000...  loss: 1.7123...  0.4642 sec/batch

step: 4180/20000...  loss: 1.7262...  0.3760 sec/batch

step: 4190/20000...  loss: 1.8545...  0.3910 sec/batch

step: 4200/20000...  loss: 1.8221...  0.3539 sec/batch

step: 4210/20000...  loss: 1.8693...  0.4472 sec/batch

step: 4220/20000...  loss: 1.8502...  0.4793 sec/batch

step: 4230/20000...  loss: 1.7788...  0.3539 sec/batch

step: 4240/20000...  loss: 1.8240...  0.4793 sec/batch

step: 4250/20000...  loss: 1.7947...  0.4101 sec/batch

step: 4260/20000...  loss: 1.8094...  0.3630 sec/batch

step: 4270/20000...  loss: 1.7775...  0.4021 sec/batch

step: 4280/20000...  loss: 1.8868...  0.3950 sec/batch

step: 4290/20000...  loss: 1.7982...  0.4532 sec/batch

step: 4300/20000...  loss: 1.8579...  0.3359 sec/batch

step: 4310/20000...  loss: 1.7709...  0.4412 sec/batch

step: 4320/20000...  loss: 1.7422...  0.4011 sec/batch

step: 4330/20000...  loss: 1.7841...  0.5775 sec/batch

step: 4340/20000...  loss: 1.7253...  0.4532 sec/batch

step: 4350/20000...  loss: 1.8973...  0.3479 sec/batch

step: 4360/20000...  loss: 1.7462...  0.3680 sec/batch

step: 4370/20000...  loss: 1.8291...  0.5204 sec/batch

step: 4380/20000...  loss: 1.7276...  0.3930 sec/batch

step: 4390/20000...  loss: 1.7404...  0.3289 sec/batch

step: 4400/20000...  loss: 1.6993...  0.4462 sec/batch

step: 4410/20000...  loss: 1.8670...  0.3920 sec/batch

step: 4420/20000...  loss: 1.8217...  0.4301 sec/batch

step: 4430/20000...  loss: 1.8339...  0.5164 sec/batch

step: 4440/20000...  loss: 1.7154...  0.3660 sec/batch

step: 4450/20000...  loss: 1.8485...  0.3920 sec/batch

step: 4460/20000...  loss: 1.7758...  0.4161 sec/batch

step: 4470/20000...  loss: 1.7017...  0.5234 sec/batch

step: 4480/20000...  loss: 1.6939...  0.3379 sec/batch

step: 4490/20000...  loss: 1.7715...  0.3951 sec/batch

step: 4500/20000...  loss: 1.7940...  0.4492 sec/batch

step: 4510/20000...  loss: 1.7804...  0.3740 sec/batch

step: 4520/20000...  loss: 1.7876...  0.5073 sec/batch

step: 4530/20000...  loss: 1.7149...  0.5825 sec/batch

step: 4540/20000...  loss: 1.7723...  0.3961 sec/batch

step: 4550/20000...  loss: 1.8180...  0.4271 sec/batch

step: 4560/20000...  loss: 1.7757...  0.4933 sec/batch

step: 4570/20000...  loss: 1.8858...  0.3309 sec/batch

step: 4580/20000...  loss: 1.7332...  0.3890 sec/batch

step: 4590/20000...  loss: 1.8466...  0.4251 sec/batch

step: 4600/20000...  loss: 1.8532...  0.3930 sec/batch

step: 4610/20000...  loss: 1.8826...  0.3850 sec/batch

step: 4620/20000...  loss: 1.8447...  0.3359 sec/batch

step: 4630/20000...  loss: 1.7697...  0.4221 sec/batch

step: 4640/20000...  loss: 1.9220...  0.3549 sec/batch

step: 4650/20000...  loss: 1.7555...  0.4011 sec/batch

step: 4660/20000...  loss: 1.8541...  0.3830 sec/batch

step: 4670/20000...  loss: 1.8676...  0.4181 sec/batch

step: 4680/20000...  loss: 1.9653...  0.3600 sec/batch

step: 4690/20000...  loss: 1.8377...  0.3981 sec/batch

step: 4700/20000...  loss: 1.7620...  0.4291 sec/batch

step: 4710/20000...  loss: 1.7802...  0.4251 sec/batch

step: 4720/20000...  loss: 1.7495...  0.4131 sec/batch

step: 4730/20000...  loss: 1.7338...  0.3299 sec/batch

step: 4740/20000...  loss: 1.9160...  0.4662 sec/batch

step: 4750/20000...  loss: 1.8142...  0.3389 sec/batch

step: 4760/20000...  loss: 1.8162...  0.3680 sec/batch

step: 4770/20000...  loss: 1.8710...  0.4552 sec/batch

step: 4780/20000...  loss: 1.8923...  0.4321 sec/batch

step: 4790/20000...  loss: 1.8062...  0.4061 sec/batch

step: 4800/20000...  loss: 1.8175...  0.4342 sec/batch

step: 4810/20000...  loss: 1.9355...  0.3459 sec/batch

step: 4820/20000...  loss: 1.7608...  0.4191 sec/batch

step: 4830/20000...  loss: 1.8031...  0.3991 sec/batch

step: 4840/20000...  loss: 1.9261...  0.4472 sec/batch

step: 4850/20000...  loss: 1.7129...  0.3981 sec/batch

step: 4860/20000...  loss: 1.7748...  0.4642 sec/batch

step: 4870/20000...  loss: 1.8557...  0.4221 sec/batch

step: 4880/20000...  loss: 1.7181...  0.4452 sec/batch

step: 4890/20000...  loss: 1.7657...  0.5134 sec/batch

step: 4900/20000...  loss: 1.8971...  0.4813 sec/batch

step: 4910/20000...  loss: 1.7947...  0.3670 sec/batch

step: 4920/20000...  loss: 1.7647...  0.4362 sec/batch

step: 4930/20000...  loss: 1.7945...  0.3509 sec/batch

step: 4940/20000...  loss: 1.7773...  0.4342 sec/batch

step: 4950/20000...  loss: 1.7854...  0.4121 sec/batch

step: 4960/20000...  loss: 1.7883...  0.3720 sec/batch

step: 4970/20000...  loss: 1.7483...  0.3700 sec/batch

step: 4980/20000...  loss: 1.8686...  0.5645 sec/batch

step: 4990/20000...  loss: 1.8472...  0.2075 sec/batch

step: 5000/20000...  loss: 1.8808...  0.1955 sec/batch

……

step: 9990/20000...  loss: 1.7760...  0.2306 sec/batch

step: 10000/20000...  loss: 1.6906...  0.2256 sec/batch

……

step: 19800/20000...  loss: 1.5745...  0.2657 sec/batch

step: 19810/20000...  loss: 1.7075...  0.2326 sec/batch

step: 19820/20000...  loss: 1.5854...  0.3660 sec/batch

step: 19830/20000...  loss: 1.6520...  0.3529 sec/batch

step: 19840/20000...  loss: 1.6153...  0.3434 sec/batch

step: 19850/20000...  loss: 1.6174...  0.3063 sec/batch

step: 19860/20000...  loss: 1.6060...  0.2717 sec/batch

step: 19870/20000...  loss: 1.5775...  0.2627 sec/batch

step: 19880/20000...  loss: 1.6181...  0.2326 sec/batch

step: 19890/20000...  loss: 1.5117...  0.2547 sec/batch

step: 19900/20000...  loss: 1.5613...  0.2356 sec/batch

step: 19910/20000...  loss: 1.6465...  0.2346 sec/batch

step: 19920/20000...  loss: 1.5160...  0.2607 sec/batch

step: 19930/20000...  loss: 1.6922...  0.2306 sec/batch

step: 19940/20000...  loss: 1.8708...  0.2527 sec/batch

step: 19950/20000...  loss: 1.5579...  0.2276 sec/batch

step: 19960/20000...  loss: 1.5850...  0.2376 sec/batch

step: 19970/20000...  loss: 1.6798...  0.2286 sec/batch

step: 19980/20000...  loss: 1.5684...  0.2667 sec/batch

step: 19990/20000...  loss: 1.4981...  0.2617 sec/batch

step: 20000/20000...  loss: 1.5322...  0.3199 sec/batch


训练的数据集展示


1、数据集展示


/**

* context_tracking_enter - Inform the context tracking that the CPU is going

*                          enter user or guest space mode.

*

* This function must be called right before we switch from the kernel

* to user or guest space, when it's guaranteed the remaining kernel

* instructions to execute won't use any RCU read side critical section

* because this function sets RCU in extended quiescent state.

*/

void context_tracking_enter(enum ctx_state state)

{

unsigned long flags;

/*

 * Repeat the user_enter() check here because some archs may be calling

 * this from asm and if no CPU needs context tracking, they shouldn't

 * go further. Repeat the check here until they support the inline static

 * key check.

 */

if (!context_tracking_is_enabled())

 return;

/*

 * Some contexts may involve an exception occuring in an irq,

 * leading to that nesting:

 * rcu_irq_enter() rcu_user_exit() rcu_user_exit() rcu_irq_exit()

 * This would mess up the dyntick_nesting count though. And rcu_irq_*()

 * helpers are enough to protect RCU uses inside the exception. So

 * just return immediately if we detect we are in an IRQ.

 */

if (in_interrupt())

 return;

/* Kernel threads aren't supposed to go to userspace */

WARN_ON_ONCE(!current->mm);

local_irq_save(flags);

if ( __this_cpu_read(context_tracking.state) != state) {

 if (__this_cpu_read(context_tracking.active)) {

  /*

   * At this stage, only low level arch entry code remains and

   * then we'll run in userspace. We can assume there won't be

   * any RCU read-side critical section until the next call to

   * user_exit() or rcu_irq_enter(). Let's remove RCU's dependency

   * on the tick.

   */

  if (state == CONTEXT_USER) {

   trace_user_enter(0);

   vtime_user_enter(current);

  }

  rcu_user_enter();

 }

 /*

  * Even if context tracking is disabled on this CPU, because it's outside

  * the full dynticks mask for example, we still have to keep track of the

  * context transitions and states to prevent inconsistency on those of

  * other CPUs.

  * If a task triggers an exception in userspace, sleep on the exception

  * handler and then migrate to another CPU, that new CPU must know where

  * the exception returns by the time we call exception_exit().

  * This information can only be provided by the previous CPU when it called

  * exception_enter().

  * OTOH we can spare the calls to vtime and RCU when context_tracking.active

  * is false because we know that CPU is not tickless.

  */

 __this_cpu_write(context_tracking.state, state);

}

local_irq_restore(flags);

}

NOKPROBE_SYMBOL(context_tracking_enter);

EXPORT_SYMBOL_GPL(context_tracking_enter);

void context_tracking_user_enter(void)

{

context_tracking_enter(CONTEXT_USER);

}

NOKPROBE_SYMBOL(context_tracking_user_enter);

/**

* context_tracking_exit - Inform the context tracking that the CPU is

*                         exiting user or guest mode and entering the kernel.

*

* This function must be called after we entered the kernel from user or

* guest space before any use of RCU read side critical section. This

* potentially include any high level kernel code like syscalls, exceptions,

* signal handling, etc...

*

* This call supports re-entrancy. This way it can be called from any exception

* handler without needing to know if we came from userspace or not.

*/

void context_tracking_exit(enum ctx_state state)

{

unsigned long flags;

if (!context_tracking_is_enabled())

 return;

if (in_interrupt())

 return;

local_irq_save(flags);

if (__this_cpu_read(context_tracking.state) == state) {

 if (__this_cpu_read(context_tracking.active)) {

  /*

   * We are going to run code that may use RCU. Inform

   * RCU core about that (ie: we may need the tick again).

   */

  rcu_user_exit();

  if (state == CONTEXT_USER) {

   vtime_user_exit(current);

   trace_user_exit(0);

  }

 }

 __this_cpu_write(context_tracking.state, CONTEXT_KERNEL);

}

local_irq_restore(flags);

}

NOKPROBE_SYMBOL(context_tracking_exit);

EXPORT_SYMBOL_GPL(context_tracking_exit);

void context_tracking_user_exit(void)

{

context_tracking_exit(CONTEXT_USER);

}

NOKPROBE_SYMBOL(context_tracking_user_exit);

 

相关文章
|
机器学习/深度学习 人工智能 自然语言处理
【自然语言处理】TF-IDF算法在人工智能方面的应用,附带代码
TF-IDF算法在人工智能领域,特别是自然语言处理(NLP)和信息检索中,被广泛用于特征提取和文本表示。以下是一个使用Python的scikit-learn库实现TF-IDF算法的简单示例,并展示如何将其应用于文本数据。
899 65
|
人工智能 监控 算法
智能时代的伦理困境:AI技术的道德边界探索人工智能在教育领域的革新之路未来编程:人工智能与代码共生的新篇章
【8月更文挑战第21天】在人工智能(AI)技术飞速发展的今天,我们正处在一个前所未有的科技变革时期。随着AI技术的深入人类生活的方方面面,它不仅带来了便利和效率的提升,同时也引发了关于道德和伦理的深刻讨论。本文将探讨AI技术发展中遇到的伦理挑战,以及如何建立合理的道德框架来指导AI的未来应用,确保技术进步与人类社会价值观的和谐共存。
643 61
|
机器学习/深度学习 人工智能 自然语言处理
【人工智能】Foxmail邮箱在人工智能领域的应用方法及代码解析
Foxmail邮箱作为一款流行的邮件客户端软件,主要用于个人和企业的邮件收发、管理等功能。虽然它与人工智能(AI)技术有着潜在的融合点,但直接关于Foxmail邮箱在人工智能方面的应用代码并不是常规的讨论内容,因为邮箱客户端本身并不直接包含复杂的AI算法或代码。
1485 58
|
机器学习/深度学习 人工智能 自然语言处理
C++构建 GAN 模型:生成器与判别器平衡训练的关键秘籍
生成对抗网络(GAN)是AI领域的明星,尤其在C++中构建时,平衡生成器与判别器的训练尤为关键。本文探讨了GAN的基本架构、训练原理及平衡训练的重要性,提出了包括合理初始化、精心设计损失函数、动态调整学习率、引入正则化技术和监测训练过程在内的五大策略,旨在确保GAN模型在C++环境下的高效、稳定训练,以生成高质量的结果,推动AI技术的发展。
507 10
|
存储 机器学习/深度学习 算法
蓝桥杯练习题(三):Python组之算法训练提高综合五十题
蓝桥杯Python编程练习题的集合,涵盖了从基础到提高的多个算法题目及其解答。
911 3
蓝桥杯练习题(三):Python组之算法训练提高综合五十题
|
机器学习/深度学习 人工智能 监控
利用人工智能审查代码:提升代码质量和安全性
【10月更文挑战第15天】本文探讨了AI在代码审查中的应用,介绍了AI辅助代码审查工具如何通过机器学习算法提升代码质量、检测潜在错误,并促进团队知识共享。文中还详细说明了实施AI辅助代码审查的步骤及其实战技巧,强调了结合人工审查、定制化模型和持续监控的重要性。
|
分布式计算 Java 开发工具
阿里云MaxCompute-XGBoost on Spark 极限梯度提升算法的分布式训练与模型持久化oss的实现与代码浅析
本文介绍了XGBoost在MaxCompute+OSS架构下模型持久化遇到的问题及其解决方案。首先简要介绍了XGBoost的特点和应用场景,随后详细描述了客户在将XGBoost on Spark任务从HDFS迁移到OSS时遇到的异常情况。通过分析异常堆栈和源代码,发现使用的`nativeBooster.saveModel`方法不支持OSS路径,而使用`write.overwrite().save`方法则能成功保存模型。最后提供了完整的Scala代码示例、Maven配置和提交命令,帮助用户顺利迁移模型存储路径。
|
机器学习/深度学习 算法 决策智能
【机器学习】揭秘深度学习优化算法:加速训练与提升性能
【机器学习】揭秘深度学习优化算法:加速训练与提升性能
|
算法 Java C++
【贪心算法】算法训练 ALGO-1003 礼物(C/C++)
【贪心算法】算法训练 ALGO-1003 礼物(C/C++)
【贪心算法】算法训练 ALGO-1003 礼物(C/C++)
|
算法 C++
蓝桥 算法训练 共线(C++)
蓝桥 算法训练 共线(C++)