Commit graph

1824 commits

Author SHA1 Message Date
Yanzhang Wang
3470d5e205 feat: quantized convolution (#1614)
* feat: quantized convolution

* fix: serialization api changes
2017-10-10 06:02:05 -04:00
Yanzhang Wang
8bf29dc119 feat: serilization for quantized modules (#1613)
* feat: serilization for quantized modules

All quantized modules extending QuantModule, which has an empty Tensor
for gradient. And the object mixes QuantSerializer for protobuf
 supporting.

* refactor: serialization api changes
2017-10-10 04:21:36 -04:00
Jerry Wu
af0aaccf68 support graph (#1636) 2017-10-10 10:26:06 +08:00
Yanzhang Wang
7a5dfa350b feat: quantized tensor support (#1611)
* feat: quantized tensor support

QuantizedTensor inherits from Tensor with supporting part of methods.
The memory is allocated from native code, so it only matains a
pointer `getNativeStorage`.

Note,

We don't support automatically `free` method. Anyone using this method
should think about the memory lacking, especially for memory
optimization.

test: quantized tensor tests

* fix: test case failed on spark 1.6
2017-10-09 08:20:01 -04:00
Yanzhang Wang
2a23278691 feat: quantization methods (#1610)
Quantization object support:

1. quantize a value with max and min.
2. quantize an array
3. quantize a Tensor[Float]

And for test, there're relative dequantize methods.
2017-10-09 04:33:18 -04:00
Jerry Wu
99da09f0ed Tensor types support (#1630)
* refinemnt to support more tensor types

* refinemnt

* refinemnt

* support object sharing

* support shared memory

* remove unused type

* refinement
2017-10-09 15:14:31 +08:00
jenniew
b63bea22a6 fix MapTable issue 2017-10-05 17:59:03 -07:00
Ian Wong
34a3b0f5fa Refine scheduler (#1607)
don't execute relevant nodes in forward/backward
fix a bug when handle const node
2017-09-29 13:23:31 +08:00
dding3
da17fa7586 Support feed prior prediction back into recurrent (#1476)
* Implement RecurrentDecoder
* add ut for lstm with recurrent decoder
2017-09-27 13:42:18 -04:00
Ian Wong
46a7195bbe 1. throw exception when ConcatTable contains no submodule (#1598)
2. rescursive remove stopGradient nodes
2017-09-27 17:13:42 +08:00
Ian Wong
ce4f777a39 Refine tensorflow loader code strcuture (#1593)
* revise tensorflow loaders

* refine more layers

* fix sytle issue

* fix style issue

* more ops

* meet code review

* fix style issue
2017-09-27 16:54:11 +08:00
zhangxiaoli73
1e1466b33d refactor predictor (#1582)
* refactor predictor

* predictClass share model output memory

* refactor repeatMemory to shareBuffer
2017-09-26 14:48:56 +08:00
Yang Wang
423027c89d Support Tensorflow Preprocessing (#1572)
* fix tensor bug

* preprocessing

* test

* fix tests

* refine

* fix tests

* fix style

* fix tests

* meet code review

* meet code review

* meet code review

* add doc
2017-09-25 16:23:09 +08:00
Yao Zhang
e66d7f6e8f Add Realdiv, BiasAdd and Pad (#1579)
* Add Pad

* refactor biasAdd
2017-09-25 15:33:33 +08:00
Yao Zhang
08161f96ed Add Assign, Cast, ExpandDims, MaxPool operations (#1562)
* add assign

* Add Cast and ExpandDims

* meet code review

* meet code reiew

* meet code review

* meet code review

* meet code review

* add comment to NumericWildcard type

* try to fix an AbstractMethod error in Cast method

* fix test failure
2017-09-25 15:22:15 +08:00
Xin Qiu
aa31da4797 fix Logsoftmax infinity error (#1576) 2017-09-21 16:02:03 +08:00
Ian Wong
f7ea6315e5 Support load tf unet (#1575)
* add deconv2d, resizebilinear and support broadcast in add

* fix test

* fix style error and meet code review

* fix python failure

* fix unit test
2017-09-21 11:53:21 +08:00
Jerry Wu
956593ad02 Handle null array (#1571)
* fix type comparision

* handle null value array

* fix type diff
2017-09-21 10:16:16 +08:00
Yao Zhang
cc21eaf0cf Add slice and onehot (#1547)
* Add slice and onehot

* refactor the code

* fit new code

* fix a typo

* meet code review

* fix test failed
2017-09-20 21:47:37 +08:00
Yang Wang
4cb832c141 Add assert, image decoders, parseExample operation (#1559)
* add some ops

* add parse example

* style

* add variable

* add png decoder

* add raw decoder

* remove resources

* fix ops

* test sig

* remove useless code

* remove import

* fix style

* fix conflict

* fix api
2017-09-20 10:02:05 +08:00
Yang Wang
42fafc3ba0 support different type in tensorflow loader (#1569)
* support different type in tensorflow

* meet code review

* meet code review

* fix tests
2017-09-19 18:51:59 +08:00
zhangxiaoli73
4d0aaf96ea optimize copy in recurrent (#1556)
* optimize copy in recurrent

* add more unit test

* select optimize

* meet review
2017-09-19 13:34:00 +08:00
Yang Wang
29626d863a support multi output in graph follow up (#1564)
* support multi-output follow up

* meet code review
2017-09-18 13:02:57 +08:00
Ian Wong
1b5ad05658 Fix failed tensorflow unit test (#1563)
* fix tf unit test

* fix unit test

* meet code review
2017-09-15 17:23:04 +08:00
Yao Zhang
e7e78e5ea9 Implement and test Conv2d operation (#1539)
* finish conv2d

* add conv2d test

* fit new code

* meet code review
2017-09-15 15:41:49 +08:00
Yao Zhang
88e2e4583b Add Floor L2Loss RandomUniform Rank MatMul SoftMax operations (#1533)
* make a layer support different type

* finish equal and make layer suppor different type

* fix conflict

* add Floor L2Loss RandomUniform Rank MatMul SoftMax

* add TruncatedNormal

* fit new code

* make jenkens pass
2017-09-15 10:34:58 +08:00
Ian Wong
b4919497fc Support switch and merge operation (#1555)
* Support control flow

* remove loop

* fix unit test

* fix unit test
2017-09-14 13:21:05 +08:00
Ian Wong
e16f246980 Fix operation logical related bugs (#1549)
* Support control flow

* Decouple input/output tensor numeric type from the module numeric type(parameter type).

* FIx unit tests

* while loop api refactor

* fix unit test

* make breeze version configurable as spark 2.1 bump breeze version

* Add scheduler to exclude layers

* remove control-flow change

* remove Schduler and ControlOps

* fix broken unit test
2017-09-12 13:39:27 +08:00
Ian Wong
d213b4df98 Display bigdl model in tensorboard (#1545)
* Display bigdl model in tensorboard

* add document, python API and meet code review.

* meet code review

* meet code review
2017-09-12 11:32:51 +08:00
Yao Zhang
416dbb4e4b Add Greater and Less operations (#1525)
* finish greater and less

* fix scala style
2017-09-07 09:52:58 +08:00
Yao Zhang
810059432e Make layer suppor different input and output numeric type and Add Equal Operation as an example (#1520)
* make a layer support different type

* finish equal and make layer suppor different type

* make code clear

* move zipwith to tensor

* fix conflict

* fix scala style error

* change an implementation for make scala2.10 compile successfully
2017-09-06 14:45:12 +08:00
Yang Wang
6f368cfa35 support loading a subset of tf graph and support control dependency in graph (#1499)
* support loading a subset of tf graph

* support load model with specified inputs

* add control dependency support in Graph

* fix file reader conflict

* fix bug

* add some comments

* fix control dep bug

* fix doc
2017-09-04 14:38:04 +08:00
Ian Wong
34baa6cfc4 Allow module output multiple tensor in Graph (#1507)
* Allow module output multiple tensor in Graph

* fix failed unit test

* meet code review

* meet code review

* more unit test

* add more unit tests

* fix unit tests

* fix style check

* fix style check and unit test

* meet code review

* support nested output

* meet code review
2017-09-04 11:19:57 +08:00
Yao Zhang
6fedfc5ca1 Add Squeeze, Prod, Sum, Reshape, Identity, ReLU (#1477)
* finsh Operation, Add, Substract, Multiply and Divide operations

* meet code review

* make acc not be supported

* meet code review

* add some operations

* add prodcut

* add default prod method in UndefinedTensorNumeric class
2017-09-01 16:34:21 +08:00
Yao Zhang
23dfc7a222 1D Max Pooling (#1436)
* finish 1D pooling

* finish documentation

* meet code review

* finish 1d pooling

* meet code review

* fix scala style errors
2017-09-01 15:29:46 +08:00
Yao Zhang
33ab8e8fe5 Add LogicalNot, LogicalOr and LogicalAnd (#1495)
* add boolean, short, int, long, string, char to tensor support

* implement and test LogicalOr and LogicalAnd operations

* add logical not

* change a typo

* refine logicalOr and logicalAnd

* fix scala code style error
2017-09-01 15:27:13 +08:00
Jerry Wu
19737f3a6e serialization - add custom data conversion support (#1511)
* add custom data conversion support

* fix issue

* add missing change

* add missing change
2017-09-01 15:22:10 +08:00
Yan Wan
d345ad10a4 add isInputWithBias and isHiddenWithBias for RNNCell (#1515)
* add isInputWithBias and isHiddenWithBias for RNNCell

* default affine = true in BatchNormParams in recurrent layer

* add serializableSpec for recurrent
2017-08-30 11:20:08 +08:00
Yang Wang
391d3feaf0 Remove the code dealing with translating tensorflow NHWC format to BigDL NCHW format (#1506)
* rm process dims code

* fix rnn and nchw test case
2017-08-29 01:18:04 -07:00
Yan Wan
170f72c534 add isSplitInput in BiRecurrent (#1514)
* add isCloneInput in BiRecurrent

* rename isCloneInput to isSplitInput

* rename test class
2017-08-29 08:40:36 +08:00
Yan Wan
a9ba423241 BifurcateSplitTable (#1513)
* add BifurcateSplitTable

* createBifurcateSplitTable

* add buffer

* clearState
2017-08-28 14:58:45 +08:00
Yan Wan
daf7344ef5 add BatchParams for BiRecurrent layer (#1512) 2017-08-28 12:59:18 +08:00
zhangxiaoli73
370291a66b change tanh backward (#1502) 2017-08-28 09:19:07 +08:00
Yan Wan
9415d4f3d0 Recurrent supports BatchNormalization (#1176)
* addPreprocessInputLayer to support BatchNormalization

* revise bnorm to hiddensize

* add comments

* add BatchNormalization between preTopology and topology

* add BatchNormalization in Recurrent

* recurrent support batchnormalization

* revise sequential to identity in throw new Error

* fix serialize

* add serializeBigDLModule

* return Unit in doSerializeModule
2017-08-25 11:09:27 +08:00
Jerry Wu
e71a4dcf55 Serialization - version control & python API (#1491)
* add version control

* version support

* add python api

* add version control proto

* add unit test

* change function name

* rename function api

* per comments

* refinement to make hierachy more cleaner

* backward compatibility
2017-08-25 08:25:40 +08:00
Yang Wang
b87cf0f95d support NHWC format in SpatialAveragePooling (#1488)
* support NHWC format in SpatialAveragePooling

* fix style

* meet code review
2017-08-24 00:27:39 -07:00
Hawkwood
4586cfa84b Give Detailed information of nn exception (#1482)
* Give Detailed information of nn exception

* modify some changes

* bug fix1
2017-08-24 11:22:24 +08:00
Xianyan
f1b8f790cd fix inplace layer clearstate (#1496)
* fix inplace layer clearstate

* meet code review

* fix bug of LeakyReLU when inplace is true
2017-08-23 13:47:54 +08:00
Xianyan
56d4d42712 [Issue #1033 #450] Disable backpropagation for general layers (#1181)
* add propagateback and generate backward graph

new unit test pass

unit test except resnet pass

unit test pass

support rebuild

support multiple inputs

fix updateGradInput and acc

fix unit test

rename to trainable, add API to set trainable at graph

unit test except inception and resnet pass

unit test pass

code clean

fix conflicts

add unit test for setTrainable, setFreeze, unFreeze

use input buffer

add getSubmodule in AbstractModule

resolve conflicts

update isInputNode

update comment

update setTrainable

fix

fix mixture of graph and container

add setFreeze python API

update python and add doc

meet code review

* meet code review

* fix unit test

* meet code review

* fix code style

* fix inception unit test

* meet code review

* meet code review

* rm cloneNode

* resolve conflicts

* fix reset

* meet code review

* meet code review

* fix
2017-08-23 10:44:11 +08:00
Yang Wang
2f75079c81 Support NHWC format in SpatialMaxPooling (#1444)
* support nhwc in SpatialMaxPooling

* add tests

* fix bug and meet code review

* add python api and doc
2017-08-20 19:51:48 -07:00