Skip to content
프로젝트

소개

Nx 기반의 전통적인 머신러닝입니다.

AI 및 머신러닝

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
-1
in 15 days
0
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

Scholar


Traditional machine learning tools built on top of Nx. Scholar implements several algorithms for classification, regression, clustering, dimensionality reduction, metrics, and preprocessing. For deep learning, see Axon.

Installation

Mix projects

Add to your mix.exs:

def deps do
  [
    {:scholar, "~> 0.5.0"}
  ]
end

Besides Scholar, you will most likely want to use an existing Nx compiler/backend, such as EXLA:

def deps do
  [
    {:scholar, "~> 0.5.0"},
    {:exla, ">= 0.0.0"}
  ]
end

And then in your config/config.exs file:

import Config
config :nx, :default_backend, EXLA.Backend
# Client can also be set to :cuda / :rocm
config :nx, :default_defn_options, [compiler: EXLA, client: :host]

JIT required! {: .warning}

It is important you set the default_defn_options as shown in the snippet above, as many algorithms in Scholar use loops which are much more memory efficient when JIT compiled.

If for some reason you cannot set a default defn compiler, you can explicitly JIT any function, for example: EXLA.jit(&Scholar.Cluster.AffinityPropagation.fit/1).

Notebooks

To use Scholar inside code notebooks, run:

Mix.install([
  {:scholar, "~> 0.5.0"},
  {:exla, ">= 0.0.0"}
])

Nx.global_default_backend(EXLA.Backend)
# Client can also be set to :cuda / :rocm
Nx.Defn.global_default_options(compiler: EXLA, client: :host)

JIT required! {: .warning}

It is important you set the Nx.Defn.global_default_options/1 as shown in the snippet above, as many algorithms in Scholar use loops which are much more memory efficient when JIT compiled.

If for some reason you cannot set a default defn compiler, you can explicitly JIT any function, for example: EXLA.jit(&Scholar.Cluster.AffinityPropagation.fit/1).

Contributing

We welcome the contribution of new algorithms to the project. However, it is important to note that we only accept implementations that are fully implemented as "numerical definitions", as this gives us the ability to compile and run all algorithms inside GPUs. This means not all algorithms can be implemented in Scholar. Decision trees/forests are one of such algorithms and for those there are additional libraries, such as EXGBoost.

Implementation wise, this means most functions simply validate options and then delegate to an implementation fully written inside a defn or defnp. You can look at this pull request as an example. We also recommend adding tests that show that you can still invoke your imlpementation after wrapping it in a Nx.Defn.jit/2 call.

License

Copyright (c) 2022 The Machine Learning Working Group of the Erlang Ecosystem Foundation

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

관련 프로젝트 살펴보기

불러오는 중…