Skip to content

Commit

Permalink
few optimizations
Browse files Browse the repository at this point in the history
  • Loading branch information
YohannFaure committed Jun 15, 2018
1 parent 3439842 commit 8a996ec
Show file tree
Hide file tree
Showing 7 changed files with 159 additions and 55 deletions.
1 change: 1 addition & 0 deletions data
5 changes: 5 additions & 0 deletions model.pickle
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
((lp0
(lp1
(lp2
tp3
.
201 changes: 148 additions & 53 deletions notebooks/04-jet-study.ipynb

Large diffs are not rendered by default.

Binary file added notebooks/test.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added notebooks/test2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion recnn/preprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def randomize(jet):
leaves = np.where(jet["tree"][:, 0] == -1)[0]
nodes = [n for n in leaves]
content = [jet["content"][n] for n in nodes]
nodes = [i for i in range(len(nodes))]
nodes = range(len(nodes))
tree = [[-1, -1] for n in nodes]
pool = [n for n in nodes]
next_id = len(nodes)
Expand Down
5 changes: 4 additions & 1 deletion train.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
from recnn.preprocessing import rewrite_content
from recnn.preprocessing import permute_by_pt
from recnn.preprocessing import extract
from recnn.preprocessing import multithreadmap


from recnn.recnn import log_loss
from recnn.recnn import adam
from recnn.recnn import grnn_init_simple
Expand Down Expand Up @@ -83,7 +86,7 @@ def train(filename_train,

# Preprocessing
logging.info("Preprocessing...")
X = [extract(permute_by_pt(rewrite_content(jet))) for jet in X]
X = multithreadmap(extract,multithreadmap(permute_by_pt,multithreadmap(rewrite_content,X)))
tf = RobustScaler().fit(np.vstack([jet["content"] for jet in X]))

for jet in X:
Expand Down

0 comments on commit 8a996ec

Please sign in to comment.