Skip to content

Commit 7fb2159

Browse files
committed
Initial opensourcing
0 parents  commit 7fb2159

27 files changed

+5443
-0
lines changed

.github/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
2+
version: 2
3+
updates:
4+
- package-ecosystem: "github-actions"
5+
directory: "/" # Location of package manifests
6+
schedule:
7+
interval: "weekly"

.github/workflows/CI.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: CI
2+
on:
3+
push:
4+
branches:
5+
- main
6+
tags: ['*']
7+
pull_request:
8+
workflow_dispatch:
9+
concurrency:
10+
# Skip intermediate builds: always.
11+
# Cancel intermediate builds: only if it is a pull request build.
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
14+
jobs:
15+
test:
16+
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
17+
runs-on: ${{ matrix.os }}
18+
timeout-minutes: 60
19+
permissions: # needed to allow julia-actions/cache to proactively delete old caches that it has created
20+
actions: write
21+
contents: read
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
version:
26+
- '1.10'
27+
- '1.6'
28+
- 'nightly'
29+
os:
30+
- ubuntu-latest
31+
arch:
32+
- x64
33+
steps:
34+
- uses: actions/checkout@v4
35+
- uses: julia-actions/setup-julia@v2
36+
with:
37+
version: ${{ matrix.version }}
38+
arch: ${{ matrix.arch }}
39+
- uses: julia-actions/cache@v2
40+
- uses: julia-actions/julia-buildpkg@v1
41+
- uses: julia-actions/julia-runtest@v1

.github/workflows/CompatHelper.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: CompatHelper
2+
on:
3+
schedule:
4+
- cron: 0 0 * * *
5+
workflow_dispatch:
6+
jobs:
7+
CompatHelper:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Pkg.add("CompatHelper")
11+
run: julia -e 'using Pkg; Pkg.add("CompatHelper")'
12+
- name: CompatHelper.main()
13+
env:
14+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15+
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
16+
run: julia -e 'using CompatHelper; CompatHelper.main()'

.github/workflows/TagBot.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: TagBot
2+
on:
3+
issue_comment:
4+
types:
5+
- created
6+
workflow_dispatch:
7+
inputs:
8+
lookback:
9+
default: "3"
10+
permissions:
11+
actions: read
12+
checks: read
13+
contents: write
14+
deployments: read
15+
issues: read
16+
discussions: read
17+
packages: read
18+
pages: read
19+
pull-requests: read
20+
repository-projects: read
21+
security-events: read
22+
statuses: read
23+
jobs:
24+
TagBot:
25+
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: JuliaRegistries/TagBot@v1
29+
with:
30+
token: ${{ secrets.GITHUB_TOKEN }}
31+
ssh: ${{ secrets.DOCUMENTER_KEY }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Manifest.toml
2+
docs/build/
3+

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Sangbum Kim, Gilhan Kim
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Project.toml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name = "RBMAdvanced"
2+
uuid = "5d974137-e137-4e27-aa2c-fdf4a8543041"
3+
authors = ["Sangbum Kim", "Gilhan Kim"]
4+
version = "1.0.0-DEV"
5+
6+
[deps]
7+
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
8+
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
9+
10+
[compat]
11+
julia = "1.6.7"
12+
13+
[extras]
14+
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
15+
16+
[targets]
17+
test = ["Test"]

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# RBMAdvanced
2+
3+
[![Build Status](https://github.com/Deepest-Project/RBMAdvanced.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/Deepest-Project/RBMAdvanced.jl/actions/workflows/CI.yml?query=branch%3Amain)
4+
5+
RBMAdvanced.jl is a library for training RBMs with methods starting from naive training to advanced training methods such as parallel tempering.
6+
7+
## Usage Example
8+
9+
Below code trains a RBM on toy dataset and infers, using CD (contrastive divergence) method.
10+
11+
```
12+
using RBMAdvanced
13+
14+
visibleSize = 2
15+
hiddenSize = 3
16+
dataset = [0 1; 0 0; 0 0] # [0 1] for 1/3 probability, [0 0] otherwise
17+
18+
weight = randInitRBMWeight(visibleSize, hiddenSize)
19+
cdConfig = TrainingConfig(
20+
usePersistentChain=false,
21+
betas=[1.0],
22+
k=1,
23+
epochs=100,
24+
learningRate=0.1
25+
)
26+
validateConfig(cdConfig)
27+
trainRBM!(weight, dataset, cdConfig)
28+
output = RBMAdvanced.inferRBM(weight, 1, 100, 100)
29+
```
30+
31+
Check out our [documentation](docs/tutorial.md) to learn more about RBMs and how to train them.

docs/images/generated_CD.png

3.98 KB
Loading

docs/images/generated_PCD.png

3.94 KB
Loading

docs/images/generated_PT.png

4.1 KB
Loading

docs/images/gt_samples.png

3.81 KB
Loading

docs/images/illustration_CD.png

168 KB
Loading

docs/images/illustration_PT.png

133 KB
Loading

0 commit comments

Comments
 (0)