This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Control.Monad (when, forM_) | |
| import qualified Data.Judy as J | |
| import Data.Maybe (fromJust) | |
| import qualified Data.Vector.Unboxed as V | |
| import Control.Applicative | |
| p10 n = do | |
| let r = floor (sqrt (fromIntegral n)) | |
| let n' = n `div` r - 1 | |
| let v1 = V.generate r $ \i -> n `div` (i + 1) -- [n `div` i | i <- [1..r]] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def P10(n): | |
| r = int(n**0.5) | |
| assert r*r <= n and (r+1)**2 > n | |
| V = [n//i for i in range(1,r+1)] | |
| V += list(range(V[-1]-1,0,-1)) | |
| S = {i:i*(i+1)//2-1 for i in V} | |
| for p in range(2,r+1): | |
| if S[p] > S[p-1]: # p is prime | |
| sp = S[p-1] # sum of primes smaller than p | |
| p2 = p*p |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import qualified Control.Monad as ControlMonad | |
| import qualified Data.Array as Array | |
| import qualified Data.Array.ST as ArrayST | |
| import qualified Data.Array.Base as ArrayBase | |
| import Control.DeepSeq | |
| import qualified Data.Map as Map | |
| -- From "The Genuine Sieve of Eratosthenes" by Melissa O'Neill. | |
| -- O(n * log n * log log n) | |
| sieve xs = sieve' xs Map.empty |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // $ g++ sparse.cpp --std=c++11 | |
| // $ time ./a.out | |
| // sum(2000000000) = 95673602693282040 | |
| // | |
| // real 0m0.150s | |
| // user 0m0.147s | |
| // sys 0m0.003s | |
| #include <iostream> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ python examples/quickstart.py | |
| [2017-07-24 23:13:32,771] Making new env: CartPole-v0 | |
| Finished episode 1 after 40 timesteps (reward: 40.0) | |
| Finished episode 2 after 25 timesteps (reward: 25.0) | |
| Finished episode 3 after 20 timesteps (reward: 20.0) | |
| Finished episode 4 after 36 timesteps (reward: 36.0) | |
| Finished episode 5 after 21 timesteps (reward: 21.0) | |
| Finished episode 6 after 44 timesteps (reward: 44.0) | |
| Finished episode 7 after 12 timesteps (reward: 12.0) | |
| Finished episode 8 after 16 timesteps (reward: 16.0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ python examples/quickstart.py | |
| [2017-07-25 01:30:48,333] Making new env: CartPole-v0 | |
| {max_kl_divergence=0.005, states={shape=(4,), type=float}, cg_damping=0.01, network=<function network_builder at 0x7f7e7a055f50>, normalize_advantage=False, actions={continuous=False, num_actions=2}, gae_lambda=0.97, line_search_steps=20, loglevel=info, override_line_search=False, batch_size=100, generalized_advantage_estimation=True, cg_iterations=20, baseline={type=mlp, repeat_update=100, size=32}} | |
| Finished episode 1 after 18 timesteps (reward: 18.0) | |
| Finished episode 2 after 19 timesteps (reward: 19.0) | |
| Finished episode 3 after 44 timesteps (reward: 44.0) | |
| Finished episode 4 after 13 timesteps (reward: 13.0) | |
| Finished episode 5 after 17 timesteps (reward: 17.0) | |
| Finished episode 6 after 22 timesteps (reward: 22.0) | |
| Finished episode 7 after 25 timesteps (reward: 25.0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Copyright 2017 reinforce.io. All Rights Reserved. | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, software | |
| # distributed under the License is distributed on an "AS IS" BASIS, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ==47003== HEAP SUMMARY: | |
| ==47003== in use at exit: 10,310,600 bytes in 10,626 blocks | |
| ==47003== total heap usage: 34,382,917 allocs, 34,372,291 frees, 6,408,626,531 bytes allocated | |
| ==47003== | |
| ==47003== 48 bytes in 1 blocks are definitely lost in loss record 1,256 of 1,984 | |
| ==47003== at 0x4C2BBAF: malloc (vg_replace_malloc.c:299) | |
| ==47003== by 0x6EA8FBD: SwigPyClientData_New (in /home/astelma/miniconda3/envs/py2/lib/python2.7/site-packages/opensim/_simbody.so) | |
| ==47003== by 0x6EB4B73: SwigPyIterator_swigregister (in /home/astelma/miniconda3/envs/py2/lib/python2.7/site-packages/opensim/_simbody.so) | |
| ==47003== by 0x4F351E4: call_function (ceval.c:4352) | |
| ==47003== by 0x4F351E4: PyEval_EvalFrameEx (ceval.c:2989) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ python run_job.py -n 5 -g 60 -c 12 --use_sync --name neptune_job_name | |
| args.offline: False | |
| ('bash command: ', 'srun -A luna -N 5 -n 5 -c 12 -t 6:00:00 distributed_tensorpack_mkl.sh 35083 45394 Breakout-v0 adam 1 "3nodes 12cores" "neptune_job_name_1517179219.79" 0.00015 128 60 0 None 256 100 1 uniform normal False . True 1 False /net/archive/groups/plggluna/intel_2/logs/ 1e-08 0.9 0.999 0 False False False False 120 False') | |
| SLURM_JOB_ID 9486553 ; SLURM_JOB_NAME distributed_tensorpack_mkl.sh ; SLURM_JOB_NODELIST p[1340-1341,1343,1347-1348] ; SLURMD_NODENAME p1341 ; SLURM_JOB_NUM_NODES 5 | |
| SLURM_JOB_ID 9486553 ; SLURM_JOB_NAME distributed_tensorpack_mkl.sh ; SLURM_JOB_NODELIST p[1340-1341,1343,1347-1348] ; SLURMD_NODENAME p1343 ; SLURM_JOB_NUM_NODES 5 | |
| SLURM_JOB_ID 9486553 ; SLURM_JOB_NAME distributed_tensorpack_mkl.sh ; SLURM_JOB_NODELIST p[1340-1341,1343,1347-1348] ; SLURMD_NODENAME p1347 ; SLURM_JOB_NUM_NODES 5 | |
| SLURM_JOB_ID 9486553 ; SLURM_JOB_NAME distributed_tensorpack_mkl.sh ; SLURM_JOB_NOD |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ python run_job.py -n 5 -g 60 -c 12 --use_sync --name neptune_job_name clear^C | |
| [prometheus][plghenrykm@login01 src]$ vim OpenAIGym/train.py | |
| [prometheus][plghenrykm@login01 src]$ python run_job.py -n 5 -g 60 -c 12 --use_sync --name neptune_job_name | |
| args.offline: False | |
| ('bash command: ', 'srun -A luna -N 5 -n 5 -c 12 -t 6:00:00 distributed_tensorpack_mkl.sh 17351 9236 Breakout-v0 adam 1 "3nodes 12cores" "neptune_job_name_1517240471.8" 0.00015 128 60 0 None 256 100 1 uniform normal False . True 1 False /net/archive/groups/plggluna/intel_2/logs/ 1e-08 0.9 0.999 0 False False False False 120 False') | |
| SLURM_JOB_ID 9495449 ; SLURM_JOB_NAME distributed_tensorpack_mkl.sh ; SLURM_JOB_NODELIST p[1567-1568,1577,1580,1584] ; SLURMD_NODENAME p1584 ; SLURM_JOB_NUM_NODES 5 | |
| SLURM_JOB_ID 9495449 ; SLURM_JOB_NAME distributed_tensorpack_mkl.sh ; SLURM_JOB_NODELIST p[1567-1568,1577,1580,1584] ; SLURMD_NODENAME p1580 ; SLURM_JOB_NUM_NODES 5 | |
| mkdir: cannot create directory ‘/net/archive/groups/plggluna |