Commit Graph

21 Commits

Author SHA1 Message Date
27c7158166 Remove __future__ imports for legacy Python2 supports (#45033)
Summary:
There is a module called `2to3` which you can target for future specifically to remove these, the directory of `caffe2` has the most redundant imports:

```2to3 -f future -w caffe2```

Pull Request resolved: https://github.com/pytorch/pytorch/pull/45033

Reviewed By: seemethere

Differential Revision: D23808648

Pulled By: bugra

fbshipit-source-id: 38971900f0fe43ab44a9168e57f2307580d36a38
2020-09-23 17:57:02 -07:00
771fcb3455 [caffe2] Fbcode to GitHub sync (#6208)
* [easy] allow empty tensor in cuda relu op

The diff has not enabled unit test of empty tensor, because MLKVersion of ReluOp need extra work to support

* Make blob norm plotting work with distributed trainer when the old framework is used
2018-04-02 16:35:27 -07:00
c6587597d8 Ignore backward step when there is no loss function;
Ignore backward step when there is no loss function;

For some customized model, we can encode the update directly in forward step and there is no backward step;
2018-03-27 18:10:39 -07:00
1d5780d42c Remove Apache headers from source.
* LICENSE file contains details, so removing from individual source files.
2018-03-27 13:10:18 -07:00
f4b1e8b334 [Dper2] Add NetModifier abstraction and support for plotting the norm of blobs (#2201) 2018-03-08 13:41:32 -08:00
41bb662d96 add dense regularization
Reviewed By: xianjiec

Differential Revision: D5617571

fbshipit-source-id: 875d7c8753bdb3b6847d5e3f47ad8568cdf172f8
2018-01-08 13:03:17 -08:00
8286ce1e3a Re-license to Apache
Summary: Closes https://github.com/caffe2/caffe2/pull/1260

Differential Revision: D5906739

Pulled By: Yangqing

fbshipit-source-id: e482ba9ba60b5337d9165f28f7ec68d4518a0902
2017-09-28 16:22:00 -07:00
920c553ac0 saving/loading CPU/GPU nets
Summary: Saving 2 nets at offline training and loading the correct net the user want. The keep_device=false will help us load gpu blobs to CPU memory.

Reviewed By: dzhulgakov

Differential Revision: D5396689

fbshipit-source-id: ff26bf3759856b07f3a1bbefac4a1e613a8a02e1
2017-07-23 02:18:15 -07:00
4a256dfc97 save/load/run nets and params with device info correctly
Summary:
===Update log 7/10===

We are now restrained from problem of connection. Will post if this problem does not fix in 2hrs.

===Update 7/6===

Luke is experimenting on the convergence of this diff. Hopefully he could present results next week

Right now this is not affecting our original CPU training pipeline because the loading op is still correct in CPU situation now.

I will need final test to make sure. But that is now blocked by log device issue t19952135

I will do CPU/GPU nets saved in a separate diff.

====Update before 7.4====
It's actually working! Include local run screenshot
{F67959016}

dogscience

Reviewed By: dzhulgakov

Differential Revision: D5307058

fbshipit-source-id: cad5d9324c239419530f4b120392ec2ccbb72280
2017-07-23 02:18:15 -07:00
47e921ba49 Remove map() and filter() in favor of comprehensions
Summary: These return views in Python 3 which would not do anything in a lot of usages currently present in Caffe2. This diff simply removes (almost) all usages of these two in Caffe2 and sub projects in favor of comprehensions which are also easier to read/understand

Reviewed By: akyrola

Differential Revision: D5142049

fbshipit-source-id: e800631d2df7d0823fed698cae46c486038007dc
2017-05-30 15:32:58 -07:00
55d293f730 remove non-existing blobs from output_schema in layer_model_instantiator
Summary: In some cases (for example, when include_tags option is used) output_schema contains blobs that aren't produced by the generated net. In this case we want to filter them from output_schema as well.

Differential Revision: D5120115

fbshipit-source-id: f98ea3f747589390b039d1e1987becec3980634c
2017-05-25 00:36:19 -07:00
22d4eaeb9e JoinContext
Summary:
Layer to allow model to follow different paths for each instantiation context and join later. Together with tagging system cleanup (this is a separate issue), this should reduce the need to write a layer to differentiate between context.

Re: tagging system clean up, we should make exclusion more explicit: EXCLUDE_FROM_<CONTEXT>. This would simplify instation code. TRAIN_ONLY should become a set of all EXCLUDE_FROM_*, except EXCLUDE_FROM_TRAIN.

Reviewed By: kennyhorror

Differential Revision: D4964949

fbshipit-source-id: ba6453b0deb92d1989404efb9d86e1ed25297202
2017-05-02 17:32:26 -07:00
a458aa4b2a Fix tags to be based on EXCLUDE_FROM_{CONTEXT}
Summary: Cleaning up the tagging system. Introducing tags EXCLUDE_FROM_{CONTEXT}.

Reviewed By: kennyhorror

Differential Revision: D4974842

fbshipit-source-id: b0fa6772299bb70afa2192c39e45191c9f41336a
2017-05-02 09:32:27 -07:00
ac7663b18c layer_model_instantiator: filter layers by tags
Summary: This diff allows to export a model partially, filtering layers by tags.

Reviewed By: kittipatv

Differential Revision: D4885610

fbshipit-source-id: 65394c5c9119d57a4d0703aa67ad8e79e4370e3b
2017-04-17 14:18:27 -07:00
58f7f2b441 doxygen python block added
Summary: Closes https://github.com/caffe2/caffe2/pull/226

Differential Revision: D4793550

Pulled By: JoelMarcey

fbshipit-source-id: cc33e58186304fa8dcac2ee9115dcc271d785b1e
2017-03-29 06:46:16 -07:00
7cc92b1260 Add eval net for layer_model_helper
Summary:
This diff is adding eval nets to layer model helper. It should be useful for
the cases when train/eval nets need some extra input (usually some supervision)
for train/eval. For example various sampled layers, etc.

Differential Revision: D4769453

fbshipit-source-id: 7a8ec7024051eab73b8869ec21e20b5f10fd9acb
2017-03-29 04:03:40 -07:00
6163676ebe Skip optimizer when param doesn't have gradient and optimizer is not set
Summary: Currently, we cannot have layer constant because layer params are required to have gradient and optimizer. Global constants don't cut for this because it can only be added once; therefore, a layer that add any global constant can only be used once.

Differential Revision: D4773212

fbshipit-source-id: 5b60d31f3c1602afb04b61f6d30b8e3e06ed2de3
2017-03-24 22:18:34 -07:00
84e742ded7 Migrate realtime training workflows to use new metrics.
Summary: This diff is getting rid of old metrics interface in realtime training.

Reviewed By: xianjiec

Differential Revision: D4649734

fbshipit-source-id: de4af85eb5476df9790ebd3915625bf8beee65af
2017-03-08 23:49:41 -08:00
e75221e316 Add eval net to two tower workflow
Summary: The evaluation part of the two tower workflow is missing. This diff is to complete it. Part of the newly added functions can be used for other workflows, eg, feed. As the eval workflow in different workflows will be overlapped, a generic eval workflow will be added in a separate diff.

Reviewed By: kennyhorror

Differential Revision: D4646880

fbshipit-source-id: 4d6eb35df10f6f613533d442f2a04dc0332386f8
2017-03-07 21:03:00 -08:00
535e0e486b Add model graph to dper_example
Summary:
Just the first version displays forward part of the training net. I want to refactor local/distributed code to share graph initialization and then visualize all nets individually.

Graphs don't look pretty because of a lot of DotProducts, we need to refactor it.

Reviewed By: xianjiec

Differential Revision: D4514479

fbshipit-source-id: 156bb07c62118b15022c87f197b5e378a7ef3b9f
2017-02-07 13:03:54 -08:00
238ceab825 fbsync. TODO: check if build files need update. 2016-11-15 00:00:46 -08:00