Skip to content

Commit

Permalink
Use to speed up optimizing
Browse files Browse the repository at this point in the history
  • Loading branch information
notadamking committed Jul 10, 2019
1 parent 5454045 commit a351a7d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions optimize.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import os
import multiprocessing
import numpy as np

from multiprocessing import Pool
Expand All @@ -14,11 +14,11 @@ def optimize_code(params):


if __name__ == '__main__':
n_processes = os.cpu_count()
n_processes = multiprocessing.cpu_count()
params = {'n_envs': n_processes}

opt_pool = Pool(processes=n_processes)
opt_pool.map(optimize_code, [params for _ in range(n_processes)])
opt_pool.imap(optimize_code, [params for _ in range(n_processes)])

from lib.RLTrader import RLTrader

Expand Down

0 comments on commit a351a7d

Please sign in to comment.