Skip to content

Commit 4161677

Browse files
committed
Add torch support
1 parent 198205e commit 4161677

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,21 @@ $ python main.py --simulation an_bn_cn -n 16
3636
* Final and intermediate solutions are saved to the `networks` sub-directory, both as `pickle` and in visual `dot` format.
3737

3838

39+
## PyTorch conversion
40+
41+
Converting a network trained using the genetic algorithm to a PyTorch module:
42+
43+
```
44+
import torch_conversion
45+
46+
with open("networks/net.pickle", "rb") as f:
47+
net = pickle.load(f)
48+
49+
torch_net = torch_conversion.mdlnn_to_torch(net)
50+
```
51+
52+
Then fine-tune and evaluate using [MDLRNN-torch](https://github.com/0xnurl/mdlrnn-torch).
53+
3954
## Parallelization
4055

4156
Native Python multiprocessing is used by default. To use MPI, change `migration_channel` to `mpi` in `simulations.py`.

0 commit comments

Comments
 (0)