Skip to content

Commit

Permalink
Updated version number + changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasondel committed Jul 16, 2021
1 parent 83509fa commit a1f5512
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 27 deletions.
23 changes: 16 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
# Releases

## 0.3.0

* added batch version of the forward-backward algorithm
* added GPU support for the forward-backward algorithm
* remove pruning option for the forward-backward algorithm

## 0.2.0

* refactoring of the FSM API.
* added a `compile` function to convert an inference graph into a compact matrix-based format suitable for fast inference
* added support for dense/sparse CPU/GPU version of the forward-backward algorithm
* the forward-backward implementation does not rely on the graph representation anymore
* added unit tests
* added `LogSemifield` type used by the graph and inference API

* refactoring of the FSM API.
* added a `compile` function to convert an inference graph into a
compact matrix-based format suitable for fast inference
* added support for dense/sparse CPU/GPU version of the
forward-backward algorithm
* the forward-backward implementation does not rely on the graph
representation anymore
* added unit tests
* added `LogSemifield` type used by the graph and inference API

## 0.1.0

Expand Down
6 changes: 1 addition & 5 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
name = "MarkovModels"
uuid = "c2ae6250-d0a1-11ea-0991-234599ce5244"
authors = ["Lucas Ondel <lucas.ondel@gmail.com>"]
version = "0.2.0"
version = "0.3.0"

[deps]
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
LogExpFunctions = "2ab3a3ac-af41-5b50-aa03-7779005ae688"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"

[compat]
CUDA = "3.3"
LogExpFunctions = "0.2"
StatsBase = "0.33"
julia = "1.6"
48 changes: 37 additions & 11 deletions src/MarkovModels.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,54 @@

module MarkovModels

using CUDA, CUDA.CUSPARSE, LinearAlgebra, SparseArrays
using StatsBase: sample, Weights
using CUDA
using CUDA.CUSPARSE
using LinearAlgebra
using SparseArrays

export FSM, LogSemifield
export αrecursion, βrecursion, αβrecursion
export addstate!, compile, determinize, gpu, link!, minimize,
renormalize!, setinit!, setfinal!, states, transpose
#======================================================================
Redefinition of some linear operations to work on GPU.
======================================================================#

# Redefinition of some linear operation to work on GPU.
include("linalg.jl")
include("culinalg.jl")

# Semifield algebras.
#======================================================================
Semifield algebras.
======================================================================#

include("semifields.jl")

# API to build and manipulate FSM.
export LogSemifield

#======================================================================
API to build and manipulate FSM.
======================================================================#

include("fsm.jl")

# FSM compilation to have inference efficient FSM format.
export FSM
export addstate!
export determinize
export link!
export minimize
export renormalize!
export setinit!
export setfinal!
export states

include("cfsm.jl")

# Inference algorithms
export CompiledFSM
export compile
export gpu

#======================================================================
Inference algorithms.
======================================================================#

include("algorithms.jl")

export αβrecursion

end
6 changes: 2 additions & 4 deletions src/semifields.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# SPDX-License-Identifier: MIT

const kMinLogDiffFloat = log(1.19209290f-7)

function mylogaddexp(x::T, y::T) where T
function logaddexp(x::T, y::T) where T
if x == T(-Inf) return y end
if y == T(-Inf) return x end

Expand Down Expand Up @@ -32,7 +30,7 @@ Base.show(io::IO, x::LogSemifield) = print(io, x.val)
Base.promote(x::LogSemifield{T}, y::Real) where T = x, LogSemifield{T}(y)
Base.promote(y::Real, x::LogSemifield{T}) where T = LogSemifield{T}(y), x
Base.:+(x::LogSemifield{T}, y::LogSemifield{T}) where T =
LogSemifield{T}(mylogaddexp(x.val, y.val))
LogSemifield{T}(logaddexp(x.val, y.val))
Base.:*(x::LogSemifield, y::LogSemifield) = LogSemifield(x.val + y.val)
Base.:/(x::LogSemifield, y::LogSemifield) = LogSemifield(x.val - y.val)
Base.zero(::Type{LogSemifield{T}}) where T = LogSemifield{T}(T(-Inf))
Expand Down

0 comments on commit a1f5512

Please sign in to comment.