• Stars
    star
    146
  • Rank 244,182 (Top 5 %)
  • Language
    Julia
  • License
    Other
  • Created over 8 years ago
  • Updated about 1 month ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Julia package of loss functions for machine learning.

LossFunctions.jl

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

License Docs Build Status Coverage Status

Available Losses

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

Please consult the documentation for other losses.

Introduction

Typically, the loss functions we work with in Machine Learning fall into the category of supervised losses. These are multivariate functions of two variables, the true target y, which represents the "ground truth" (i.e. correct answer), and the predicted output Ε·, which is what our model thinks the truth is. A supervised loss function takes these two variables as input and returns a value that quantifies how "bad" our prediction is in comparison to the truth. In other words: the lower the loss, the better the prediction.

This package provides a considerable amount of carefully implemented loss functions, as well as an API to query their properties (e.g. convexity). Furthermore, we expose methods to compute their values, derivatives, and second derivatives for single observations as well as arbitrarily sized arrays of observations. In the case of arrays a user additionally has the ability to define if and how element-wise results are averaged or summed 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 information on 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β‹…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Μ‚                            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.

More Repositories

1

MLDatasets.jl

Utility package for accessing common Machine Learning datasets in Julia
Julia
218
star
2

Reinforce.jl

Abstractions, algorithms, and utilities for reinforcement learning in Julia
Julia
201
star
3

OpenAIGym.jl

OpenAI's Gym binding for Julia
Julia
104
star
4

MLDataUtils.jl

Utility package for generating, loading, splitting, and processing Machine Learning datasets
Julia
101
star
5

TableTransforms.jl

Transforms and pipelines with tabular data in Julia
Julia
100
star
6

MLUtils.jl

Utilities and abstractions for Machine Learning tasks
Julia
99
star
7

OpenAI.jl

OpenAI API wrapper for Julia
Julia
86
star
8

LIBSVM.jl

LIBSVM bindings for Julia
Julia
85
star
9

MLDataPattern.jl

Utility package for subsetting, resampling, iteration, and partitioning of various types of data sets in Machine Learning
Julia
60
star
10

Learn.jl

JuliaML bundled in a convenient all-in-one toolkit.
Julia
57
star
11

AtariAlgos.jl

Arcade Learning Environment (ALE) wrapped as a Reinforce.jl environment
Julia
40
star
12

MLLabelUtils.jl

Utility package for working with classification targets and label-encodings
Julia
32
star
13

Transformations.jl

Static transforms, activation functions, and other implementations of LearnBase abstractions
Julia
31
star
14

StochasticOptimization.jl

Implementations of stochastic optimization algorithms and solvers
Julia
30
star
15

DensityRatioEstimation.jl

Density ratio estimation in Julia
Julia
30
star
16

ValueHistories.jl

Utilities to efficiently track learning curves or other optimization information
Julia
29
star
17

LearningStrategies.jl

A generic and modular framework for building custom iterative algorithms in Julia
Julia
28
star
18

PenaltyFunctions.jl

Julia package of regularization functions for machine learning
Julia
26
star
19

MLMetrics.jl

Metrics for scoring machine learning models in Julia
Julia
25
star
20

MLPlots.jl

Plotting recipes for statistics and machine learning using Plots.jl
Julia
24
star
21

TableDistances.jl

Distances between heterogeneous tabular data
Julia
23
star
22

LearnBase.jl

Abstractions for Julia Machine Learning Packages
Julia
17
star
23

MLPreprocessing.jl

Julia
15
star
24

LIBLINEAR.jl

LIBLINEAR bindings for Julia
Julia
11
star
25

META

Discussions related to the future of Machine Learning in Julia
10
star
26

OpenAIGymAPI.jl

A Julia package providing access to the OpenAI Gym API
Julia
10
star
27

ContinuousOptimization.jl

A playground for implementations of unconstrained continuous full-batch optimization algorithms
Julia
8
star
28

TransformsBase.jl

Base package for general data transformations in Julia
Julia
7
star
29

DataScienceTraits.jl

Traits for data science
Julia
6
star
30

ObjectiveFunctions.jl

Generic definitions of objective functions using abstractions from LearnBase
Julia
5
star
31

JuliaML.github.io

The home page of the JuliaML organization
JavaScript
5
star
32

StatsLearnModels.jl

Statistical learning models for tabular data
Julia
4
star
33

Prox.jl

Bank of proximal operators to support proximal optimization algorithms
Julia
3
star
34

RankAggregation.jl

Rank aggregation in Julia
Julia
3
star
35

FileStorage

Storage for images and other binary files used throughout our documentation
Julia
2
star
36

TransformsAPI.jl

Julia API for general data transformations
Julia
2
star
37

ColumnSelectors.jl

Column selectors for tables
Julia
2
star