Skip to content

Commit a983622

Browse files
committed
Created readthedocs documentation files (start)
1 parent 2c5e2ab commit a983622

File tree

8 files changed

+494
-1
lines changed

8 files changed

+494
-1
lines changed

docs/README.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/_static/custom.css

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/* Custom CSS for FIT documentation */
2+
3+
.wy-nav-content {
4+
max-width: none;
5+
}
6+
7+
.rst-content .code-block-caption {
8+
background-color: #f8f8f8;
9+
border: 1px solid #e1e4e5;
10+
padding: 6px 12px;
11+
margin-bottom: -1px;
12+
font-size: 14px;
13+
}
14+
15+
.rst-content pre.literal-block, .rst-content div[class^="highlight"] pre {
16+
font-size: 14px;
17+
line-height: 1.4;
18+
}
19+
20+
/* Better code highlighting */
21+
.highlight .k { color: #0000ff; }
22+
.highlight .s { color: #008000; }
23+
.highlight .c { color: #808080; font-style: italic; }
24+
25+
/* Improve table styling */
26+
.rst-content table.docutils {
27+
border: 1px solid #e1e4e5;
28+
}
29+
30+
.rst-content table.docutils td, .rst-content table.docutils th {
31+
border: 1px solid #e1e4e5;
32+
padding: 8px 16px;
33+
}

docs/api/core.rst

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
Core Components
2+
===============
3+
4+
The core module contains the fundamental building blocks of FIT.
5+
6+
Tensor
7+
------
8+
9+
.. automodule:: fit.core.tensor
10+
:members:
11+
:undoc-members:
12+
:show-inheritance:
13+
14+
Autograd
15+
--------
16+
17+
.. automodule:: fit.core.autograd
18+
:members:
19+
:undoc-members:
20+
:show-inheritance:
21+
22+
Exceptions
23+
----------
24+
25+
.. automodule:: fit.core.exceptions
26+
:members:
27+
:undoc-members:
28+
:show-inheritance:

docs/api/nn.rst

Whitespace-only changes.

docs/conf.py

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
#
3+
# For the full list of built-in configuration values, see the documentation:
4+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
5+
6+
import os
7+
import sys
8+
9+
# -- Path setup --------------------------------------------------------------
10+
# If extensions (or modules to document with autodoc) are in another directory,
11+
# add these directories to sys.path here. If the directory is relative to the
12+
# documentation root, use os.path.abspath to make it absolute, like shown here.
13+
14+
sys.path.insert(0, os.path.abspath('../'))
15+
16+
# -- Project information -----------------------------------------------------
17+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
18+
19+
project = 'FIT'
20+
copyright = '2025, Łukasz Bielaszewski'
21+
author = 'Łukasz Bielaszewski'
22+
release = '0.8.0'
23+
version = '0.8.0'
24+
25+
# -- General configuration ---------------------------------------------------
26+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
27+
28+
extensions = [
29+
'sphinx.ext.autodoc',
30+
'sphinx.ext.viewcode',
31+
'sphinx.ext.napoleon',
32+
'sphinx.ext.intersphinx',
33+
'sphinx.ext.todo',
34+
'sphinx.ext.coverage',
35+
'sphinx.ext.mathjax',
36+
'myst_parser',
37+
]
38+
39+
templates_path = ['_templates']
40+
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
41+
42+
# -- Options for HTML output -------------------------------------------------
43+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
44+
45+
html_theme = 'sphinx_rtd_theme'
46+
html_static_path = ['_static']
47+
48+
# -- Extension configuration -------------------------------------------------
49+
50+
# Napoleon settings
51+
napoleon_google_docstring = True
52+
napoleon_numpy_docstring = True
53+
napoleon_include_init_with_doc = False
54+
napoleon_include_private_with_doc = False
55+
napoleon_include_special_with_doc = True
56+
napoleon_use_admonition_for_examples = False
57+
napoleon_use_admonition_for_notes = False
58+
napoleon_use_admonition_for_references = False
59+
napoleon_use_ivar = False
60+
napoleon_use_param = True
61+
napoleon_use_rtype = True
62+
napoleon_preprocess_types = False
63+
napoleon_type_aliases = None
64+
napoleon_attr_annotations = True
65+
66+
# Autodoc settings
67+
autodoc_default_options = {
68+
'members': True,
69+
'member-order': 'bysource',
70+
'special-members': '__init__',
71+
'undoc-members': True,
72+
'exclude-members': '__weakref__'
73+
}
74+
75+
# Intersphinx mapping
76+
intersphinx_mapping = {
77+
'python': ('https://docs.python.org/3/', None),
78+
'numpy': ('https://numpy.org/doc/stable/', None),
79+
}
80+
81+
# MyST parser settings
82+
myst_enable_extensions = [
83+
"colon_fence",
84+
"deflist",
85+
"dollarmath",
86+
"html_admonition",
87+
"html_image",
88+
"linkify",
89+
"replacements",
90+
"smartquotes",
91+
"substitution",
92+
"tasklist",
93+
]
94+
95+
# Theme options
96+
html_theme_options = {
97+
'canonical_url': '',
98+
'analytics_id': '',
99+
'logo_only': False,
100+
'display_version': True,
101+
'prev_next_buttons_location': 'bottom',
102+
'style_external_links': False,
103+
'vcs_pageview_mode': '',
104+
'style_nav_header_background': '#2980B9',
105+
'collapse_navigation': True,
106+
'sticky_navigation': True,
107+
'navigation_depth': 4,
108+
'includehidden': True,
109+
'titles_only': False
110+
}
111+
112+
# Add any paths that contain custom static files (such as style sheets) here,
113+
# relative to this directory. They are copied after the builtin static files,
114+
# so a file named "default.css" will overwrite the builtin "default.css".
115+
html_css_files = [
116+
'custom.css',
117+
]
118+
119+
# The master toctree document.
120+
master_doc = 'index'

docs/index.rst

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
FIT: Machine Learning Library
2+
=============================
3+
4+
A PyTorch-like machine learning library built from scratch with NumPy. Train neural networks with automatic differentiation, no dependencies beyond NumPy.
5+
6+
.. image:: https://github.com/Klus3kk/fit/actions/workflows/ci.yml/badge.svg
7+
:target: https://github.com/Klus3kk/fit/actions/workflows/ci.yml
8+
:alt: Tests
9+
10+
.. image:: https://img.shields.io/badge/License-MIT-yellow.svg
11+
:target: https://opensource.org/licenses/MIT
12+
:alt: License
13+
14+
Quick Start
15+
-----------
16+
17+
Install FIT:
18+
19+
.. code-block:: bash
20+
21+
pip install git+https://github.com/Klus3kk/fit.git
22+
23+
Solve XOR problem:
24+
25+
.. code-block:: python
26+
27+
from fit.core.tensor import Tensor
28+
from fit.nn.modules.container import Sequential
29+
from fit.nn.modules.linear import Linear
30+
from fit.nn.modules.activation import ReLU
31+
from fit.loss.regression import MSELoss
32+
from fit.optim.adam import Adam
33+
34+
# XOR dataset
35+
X = Tensor([[0, 0], [0, 1], [1, 0], [1, 1]])
36+
y = Tensor([[0], [1], [1], [0]])
37+
38+
# Model
39+
model = Sequential(
40+
Linear(2, 8),
41+
ReLU(),
42+
Linear(8, 1)
43+
)
44+
45+
# Training
46+
loss_fn = MSELoss()
47+
optimizer = Adam(model.parameters(), lr=0.01)
48+
49+
for epoch in range(1000):
50+
pred = model(X)
51+
loss = loss_fn(pred, y)
52+
53+
optimizer.zero_grad()
54+
loss.backward()
55+
optimizer.step()
56+
57+
Why FIT?
58+
--------
59+
60+
- **Lightweight**: Only requires NumPy
61+
- **Educational**: Understand ML from first principles
62+
- **Familiar API**: PyTorch-like interface
63+
- **Production ready**: Type hints, logging, proper error handling
64+
65+
Documentation
66+
-------------
67+
68+
.. toctree::
69+
:maxdepth: 2
70+
:caption: Getting Started
71+
72+
installation
73+
quickstart
74+
tutorials/index
75+
76+
.. toctree::
77+
:maxdepth: 2
78+
:caption: API Reference
79+
80+
api/core
81+
api/nn
82+
api/optim
83+
api/loss
84+
api/data
85+
86+
.. toctree::
87+
:maxdepth: 2
88+
:caption: Examples
89+
90+
examples/basic
91+
examples/advanced
92+
93+
.. toctree::
94+
:maxdepth: 1
95+
:caption: Development
96+
97+
contributing
98+
changelog
99+
100+
Indices and tables
101+
==================
102+
103+
* :ref:`genindex`
104+
* :ref:`modindex`
105+
* :ref:`search`

docs/installation.rst

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
Installation
2+
============
3+
4+
Requirements
5+
------------
6+
7+
FIT requires:
8+
9+
- Python 3.9 or higher
10+
- NumPy 1.21.0 or higher
11+
- PyYAML 6.0 or higher
12+
13+
Install from GitHub
14+
-------------------
15+
16+
The recommended way to install FIT is directly from GitHub:
17+
18+
.. code-block:: bash
19+
20+
pip install git+https://github.com/Klus3kk/fit.git
21+
22+
Install from Source
23+
-------------------
24+
25+
To install from source for development:
26+
27+
.. code-block:: bash
28+
29+
git clone https://github.com/Klus3kk/fit.git
30+
cd fit
31+
pip install -e .
32+
33+
For development with all dependencies:
34+
35+
.. code-block:: bash
36+
37+
pip install -e ".[dev,examples]"
38+
39+
Verify Installation
40+
-------------------
41+
42+
To verify your installation works:
43+
44+
.. code-block:: python
45+
46+
import fit
47+
from fit.core.tensor import Tensor
48+
49+
x = Tensor([1, 2, 3])
50+
print(f"FIT installed successfully! Tensor: {x}")
51+
52+
Docker Installation
53+
-------------------
54+
55+
You can also use Docker:
56+
57+
.. code-block:: bash
58+
59+
docker-compose up fit-ml
60+
61+
Troubleshooting
62+
---------------
63+
64+
Common Issues
65+
~~~~~~~~~~~~~
66+
67+
**Import Error**: Make sure you have Python 3.9+ and NumPy installed.
68+
69+
**Module Not Found**: Ensure you're using the correct import paths (e.g., ``from fit.core.tensor import Tensor``).
70+
71+
**Performance Issues**: FIT is CPU-only. For GPU acceleration, consider using with other frameworks.

0 commit comments

Comments
 (0)