Advertisement

神经网络排序(Python版) 神经网络排序(Python版)

阅读量:

基于R语言构建的神经网络模型用于排序任务,其开发过程中引用了caret与neuralnet这两个核心库。该方法的实现机制相对简单明了,原始文献中提供了完成该过程所需的关键代码片段。

复制代码
    library(neuralnet)
    
    # Helper method to generate a training set containing size random numbers (a, b, c) and sorted (x, y, z).
    generateSet <- function(size = 100, max = 100) {
      # Generate size random numbers between 1 and max.
      training <- data.frame(a=sample(1:max, size, replace=TRUE), 
                         b=sample(1:max, size, replace=TRUE), 
                         c=sample(1:max, size, replace=TRUE))
    
      # Generate output examples by sorting the numbers.

全部评论 (0)

还没有任何评论哟~