DLForMovieRecommend | 记录自己毕设遇到的困难和解决的过程 - 2019/1/21 2

 by   goldfishh Python Version: Current License: No License

kandi X-RAY | DLForMovieRecommend Summary

kandi X-RAY | DLForMovieRecommend Summary

DLForMovieRecommend is a Python library. DLForMovieRecommend has no bugs, it has no vulnerabilities and it has low support. However DLForMovieRecommend build file is not available. You can download it from GitHub.

2019/1/21 2. loss函数为负数,且不断向负无穷逼近 self.out = tf.sigmoid(self.out_train - self.out_nega) self.loss = tf.losses.compute_weighted_loss(tf.log(tf.clip_by_value(self.out, 1e-8, 1.0))). 改为 -> self.loss = tf.losses.compute_weighted_loss(self.out) 或 -> self.loss = tf.losses.compute_weighted_loss(-tf.log(tf.clip_by_value(self.out, 1e-8, 1.0))). 2019/1/22 4. 回到第一个问题,nan问题是用一个函数:tf.clip_by_value() 解决了,但是呢训练的时候会一直在一个值上下波动, 这篇文章也提到了这个问题: 问题的原因可能是:单纯的cut上下界值会影响优化, 解决的办法是:考虑神经网络每层的值域, 通过激励函数:sigmoid, 初始化的参数也可能要考虑进去. 进过修改后的神经网络终于朝着loss函数减小的方向前进了. 5.嗯,朝着loss函数增大方向了! loss定义: self.positive = -tf.log(self.last_pair_out) self.negative = -tf.log(1-self.out) self.loss = tf.reduce_sum(self.positive + self.negative). 原来的模型输入是这样子的, 如下 self.train_features = tf.placeholder(tf.int32, shape=[2, None, None], name='featureV') self.last_pair_out = tf.placeholder(tf.float32, shape=[None, 1], name='lastPairOut'). 然后在训练的时候,先喂正样本的数据 out = self.sess.run(self.out, feed_dict=feed_dict) feed_dict[self.last_pair_out] = out 然后在喂负样本: 这样子训练是会让loss函数一直增大的! 从书上大致了解到,神经网络在训练的时候是用梯度下降的!,具体是计算从损失函数到每个可变参数(Viariable)的梯度,然后乘以一个学习率,然后相减. 在这里,self.positive, 实际上可以看做是一个常数, 所以损失函数实际只有负样本起作用, self.negative减小的同时, self.positive会增大!,所以总的损失函数增大是有可能的! 解决办法是: 用placeholder把正负样本都加进去, 产生两个输入流, 最后汇聚在损失函数 过程中可能覆盖了变量, 相同变量被重复赋值(因为有两个输入流),结果上是朝正确方向的. 2019/1/23 6.训练大约200轮后,loss收敛了, 但是HR指标不理想, 每个用户推荐10个电影, 总共只有277次命中 HR=0.023 这个结果显然是不理想的!也就比随机好点 后面应该怎么寻找问题呢?.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              DLForMovieRecommend has a low active ecosystem.
              It has 0 star(s) with 0 fork(s). There are no watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              DLForMovieRecommend has no issues reported. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of DLForMovieRecommend is current.

            kandi-Quality Quality

              DLForMovieRecommend has no bugs reported.

            kandi-Security Security

              DLForMovieRecommend has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              DLForMovieRecommend does not have a standard license declared.
              Check the repository for any license declaration and review the terms closely.
              OutlinedDot
              Without a license, all rights are reserved, and you cannot use the library in your applications.

            kandi-Reuse Reuse

              DLForMovieRecommend releases are not available. You will need to build from source code and install.
              DLForMovieRecommend has no build file. You will be need to create the build yourself to build the component from source.
              Installation instructions are not available. Examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of DLForMovieRecommend
            Get all kandi verified functions for this library.

            DLForMovieRecommend Key Features

            No Key Features are available at this moment for DLForMovieRecommend.

            DLForMovieRecommend Examples and Code Snippets

            No Code Snippets are available at this moment for DLForMovieRecommend.

            Community Discussions

            No Community Discussions are available at this moment for DLForMovieRecommend.Refer to stack overflow page for discussions.

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install DLForMovieRecommend

            You can download it from GitHub.
            You can use DLForMovieRecommend like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/goldfishh/DLForMovieRecommend.git

          • CLI

            gh repo clone goldfishh/DLForMovieRecommend

          • sshUrl

            git@github.com:goldfishh/DLForMovieRecommend.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link