LossFunctions.jl

授权协议 View license
开发语言
所属分类 神经网络/人工智能、 机器学习/深度学习
软件类型 开源软件
地区 不详
投 递 者 徐文彬
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

LossFunctions

LossFunctions.jl is a Julia package that provides efficient andwell-tested implementations for a diverse set of loss functionsthat are commonly used in Machine Learning.

Available Losses

Distance-based (Regression) Margin-based (Classification)
distance_losses margin_losses

Please consult the documentationfor other losses.

Introduction

Typically, the loss functions we work with in Machine Learningfall into the category of supervised losses. These aremultivariate functions of two variables, the true target y,which represents the "ground truth" (i.e. correct answer), andthe predicted output ŷ, which is what our model thinks thetruth is. A supervised loss function takes these two variables asinput and returns a value that quantifies how "bad" ourprediction is in comparison to the truth. In other words: thelower the loss, the better the prediction.

This package provides a considerable amount of carefullyimplemented loss functions, as well as an API to query theirproperties (e.g. convexity). Furthermore, we expose methods tocompute their values, derivatives, and second derivatives forsingle observations as well as arbitrarily sized arrays ofobservations. In the case of arrays a user additionally has theability to define if and how element-wise results are averaged orsummed over.

Documentation

Check out the latest documentation

Additionally, you can make use of Julia's native docsystem.The following example shows how to get additional informationon HingeLoss within Julia's REPL:

?HingeLoss
search: HingeLoss L2HingeLoss L1HingeLoss SmoothedL1HingeLoss

  L1HingeLoss <: MarginLoss

  The hinge loss linearly penalizes every predicition where the
  resulting agreement a = y⋅ŷ < 1 . It is Lipschitz continuous
  and convex, but not strictly convex.

  L(a) = \max \{ 0, 1 - a \}

  --------------------------------------------------------------------

                Lossfunction                     Derivative
        ┌────────────┬────────────┐      ┌────────────┬────────────┐
      3 │'\.                      │    0 │                  ┌------│
        │  ''_                    │      │                  |      │
        │     \.                  │      │                  |      │
        │       '.                │      │                  |      │
      L │         ''_             │   L' │                  |      │
        │            \.           │      │                  |      │
        │              '.         │      │                  |      │
      0 │                ''_______│   -1 │------------------┘      │
        └────────────┴────────────┘      └────────────┴────────────┘
        -2                        2      -2                        2
                   y ⋅ ŷ                            y ⋅ ŷ

Installation

Get the latest stable release with Julia's package manager:

] add LossFunctions

License

This code is free to use under the terms of the MIT license.

  • LowRankModels.jl是一个用于建模和拟合广义低阶模型(GLRMs)的Julia工具包。 LowRankModels.jl is a julia package for modeling and fitting generalized low rank models (GLRMs).  GLRMs用低阶矩阵对一个数据数组进行建模,并在数据分析中包括了许多著名的模型,如主成分分析(PCA)

相关阅读

相关文章

相关问答

相关文档