Skip to content

Commit

Permalink
Merge 505de00 into 20e4eb4
Browse files Browse the repository at this point in the history
  • Loading branch information
alyst committed Aug 2, 2021
2 parents 20e4eb4 + 505de00 commit 1beae18
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 27 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/TagBot.yml
@@ -0,0 +1,14 @@
name: TagBot
on:
issue_comment:
types:
- created
workflow_dispatch:
jobs:
TagBot:
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
runs-on: ubuntu-latest
steps:
- uses: JuliaRegistries/TagBot@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
54 changes: 54 additions & 0 deletions .github/workflows/ci.yml
@@ -0,0 +1,54 @@
name: CI
on:
push:
branches: [master]
tags: ["*"]
pull_request:
jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
version:
- '1.0'
- '1' # automatically expands to the latest stable 1.x release of Julia
- 'nightly'
os:
- ubuntu-latest
- macOS-latest
- windows-latest
arch:
- x64
- x86
exclude:
- os: macOS-latest
arch: x86
- os: ubuntu-latest
arch: x86 # libhdf5 problems
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: actions/cache@v1
env:
cache-name: cache-artifacts
with:
path: ~/.julia/artifacts
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
restore-keys: |
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
- name: Install Python Dependencies (for MLDatasets)
run: python -m pip install scipy
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
- uses: julia-actions/julia-processcoverage@v1
- uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: lcov.info
15 changes: 0 additions & 15 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Project.toml
Expand Up @@ -10,7 +10,7 @@ ProgressMeter = "92933f4c-e287-5a05-a399-4b506db050ca"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"

[compat]
Distances = "0.9.0"
Distances = "0.9.0, 0.10"
ProgressMeter = "1.3.2"
julia = "1.5"

Expand Down
7 changes: 2 additions & 5 deletions README.md
@@ -1,11 +1,8 @@
t-SNE (t-Stochastic Neighbor Embedding)
=======================================

[![Julia 0.6 Status](http://pkg.julialang.org/badges/TSne_0.6.svg)](http://pkg.julialang.org/?pkg=TSne&ver=0.6)
[![Julia 0.7 Status](http://pkg.julialang.org/badges/TSne_0.7.svg)](http://pkg.julialang.org/?pkg=TSne&ver=0.7)

[![Build Status](https://travis-ci.org/lejon/TSne.jl.svg?branch=master)](https://travis-ci.org/lejon/TSne.jl)
[![Coverage Status](https://coveralls.io/repos/github/lejon/TSne.jl/badge.svg?branch=master)](https://coveralls.io/github/lejon/TSne.jl?branch=master)
[![Build Status]((https://github.com/lejon/TSne.jl/workflows/CI/badge.svg)](https://github.com/lejon/TSne.jl/actions?query=workflow%3ACI+branch%3Amaster)
[![Coverage Status](https://coveralls.io/repos/github/lejon/TSne.jl/badge.svg)](https://coveralls.io/github/lejon/TSne.jl)

Julia implementation of L.J.P. van der Maaten and G.E. Hintons [t-SNE visualisation technique](https://lvdmaaten.github.io/tsne/).

Expand Down
4 changes: 2 additions & 2 deletions examples/demo.jl
Expand Up @@ -25,7 +25,7 @@ if ARGS[1] == "iris"
using RDatasets
println("Using Iris dataset.")
iris = dataset("datasets","iris")
X = convert(Matrix{Float64}, iris[:, 1:4])
X = hcat(eachcol(iris)[1:4]...)
labels = iris[:, 5]
plotname = "iris"
initial_dims = -1
Expand All @@ -37,7 +37,7 @@ elseif ARGS[1] == "mnist"
X, labels = MNIST.traindata(Float64);
npts = min(2500, size(X, 3), length(labels))
labels = string.(labels[1:npts])
X = rescale(transpose(reshape(X[:, :, 1:npts], (28*28, :))))
X = rescale(transpose(reshape(X[:, :, 1:npts], (size(X, 1)*size(X, 2), :))))
plotname = "mnist"
initial_dims = 50
iterations = 1000
Expand Down
7 changes: 3 additions & 4 deletions test/test_tsne.jl
@@ -1,7 +1,7 @@
@testset "tsne()" begin
@testset "API tests" begin
iris = dataset("datasets", "iris")
X = convert(Matrix{Float64}, iris[:, 1:4])
X = hcat(eachcol(iris)[1:4]...)
Y = tsne(X, 2, -1, 10, 15, verbose=true)
@test size(Y) == (150, 2)
Y = tsne(X, 3, -1, 10, 15, verbose=false)
Expand Down Expand Up @@ -42,7 +42,7 @@

@testset "Iris dataset" begin
iris = dataset("datasets", "iris")
X = convert(Matrix{Float64}, iris[:, 1:4])
X = hcat(eachcol(iris)[1:4]...)
# embed in 3D
Y3d = tsne(X, 3, -1, 100, 15, progress=false)
@test size(Y3d) == (150, 3)
Expand All @@ -56,11 +56,10 @@
train_data, labels = MLDatasets.with_accept(true) do
MNIST.traindata(Float64)
end
X_labels = labels[1:2500] .+ 1
X = reshape(permutedims(train_data[:, :, 1:2500], (3, 1, 2)),
2500, size(train_data, 1)*size(train_data, 2))
X .-= mean(X, dims=1)
X ./= std(X, dims=1)
X ./= map(x -> ifelse(x > 0, x, 1.0), std(X, dims=1))

Y = tsne(X, 2, 50, 2000, 20, progress=true)
@test size(Y) == (2500, 2)
Expand Down

0 comments on commit 1beae18

Please sign in to comment.