1
0
mirror of https://github.com/tensorflow/haskell.git synced 2024-07-05 02:43:29 +02:00
Commit Graph

5 Commits

Author SHA1 Message Date
Judah Jacobson
2c5c879037 Introduce a MonadBuild class, and remove buildAnd. (#83)
This change adds a class that both `Build` and `Session` are instances of:

    class MonadBuild m where
        build :: Build a -> m a

All stateful ops (generated and manually written) now have a signature that returns
an instance of `MonadBuild` (rather than just `Build`).  For example:

    assign_ :: (MonadBuild m, TensorType t)
            => Tensor Ref t -> Tensor v t -> m (Tensor Ref t)

This lets us remove a bunch of spurious calls to `build` in user code.  It also
lets us replace the pattern `buildAnd run foo` with the simpler pattern `foo >>= run`
(or `run =<< foo`, which is sometimes nicer when foo is a complicated expression).

I went ahead and deleted `buildAnd` altogether since it seems to lead to
confusion; in particular a few tests had `buildAnd run . pure` which is
actually equivalent to just `run`.
2017-03-18 12:08:53 -07:00
Greg Steuck
2b5e41ffeb Make code --pedantic (#35)
* Enforce pedantic build mode in CI.
* Our imports drifted really far from where they should be.
2016-11-18 10:42:02 -08:00
Noon van der Silk
69fdbf677f test case to show can't calculate grad for embedding (and associated fix) (#23)
* Fix for embedding gradient calculation

- Passes vectors instead of scalars to slice
- converts the numRows to a scalar
- add `toScalar` utility function
- minor change to test case so that it actually works

* added lib for testing helper functions

* add flatSlice function
2016-11-17 13:54:36 -08:00
Greg Steuck
9f2f4e2877 Fixed CI and added indicator. (#15)
* Sorted test names.

* Don't require a terminal to run tests.

Should resolve "the input device is not a TTY" problem with Jenkins.

* Added build indicator to README.md.

* Fixed up URL.
2016-10-28 18:08:32 -07:00
Noon van der Silk
b2795d7518 Starting NN library (#11)
* Starting NN library

- Added "sigmoidCrossEntropyWithLogits"
- Ported across a single test
2016-10-27 18:05:27 -07:00