Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
SPIN
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Andrea Mancini
SPIN
Commits
e8359e0b
Commit
e8359e0b
authored
Jul 29, 2024
by
Andrea Mancini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor update
parent
35cb1af3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
preprocessing.py
data/preprocessing.py
+6
-6
train_evulation_TRX.ipynb
notebooks/train_evulation_TRX.ipynb
+0
-0
No files found.
data/preprocessing.py
View file @
e8359e0b
...
...
@@ -94,9 +94,9 @@ class MyDataset:
splits
=
make_splits
(
self
.
targets
,
seed
,
val_set
,
stratify
=
stratify
)
self
.
_train_idx
=
self
.
data_ids
[
splits
[
'train'
]]
self
.
_test_idx
=
self
.
data_ids
[
splits
[
'test'
]]
self
.
_train_y
=
self
.
targets
[
splits
[
'train'
]]
self
.
_test_idx
=
self
.
data_ids
[
splits
[
'test'
]]
self
.
_test_y
=
self
.
targets
[
splits
[
'test'
]]
self
.
_val_y
=
None
...
...
@@ -130,7 +130,7 @@ class MyDataset:
test_ds
=
_MyDataset
(
self
.
_test_idx
,
self
.
_test_y
,
tokenizer
,
fpath
)
train_loader
=
DataLoader
(
train_ds
,
batch_sampler
=
BatchSampler
(
RandomSampler
(
train_ds
),
batch_size
=
batch_size
,
drop_last
=
False
),
pin_memory
=
True
,
num_workers
=
4
train_ds
,
batch_sampler
=
BatchSampler
(
RandomSampler
(
train_ds
),
batch_size
=
batch_size
,
drop_last
=
False
),
pin_memory
=
True
,
num_workers
=
4
)
test_loader
=
DataLoader
(
test_ds
,
batch_sampler
=
BatchSampler
(
SequentialSampler
(
test_ds
),
batch_size
=
batch_size
,
drop_last
=
False
),
pin_memory
=
True
,
num_workers
=
4
...
...
@@ -145,9 +145,9 @@ class MyDataset:
if
self
.
_val_y
is
not
None
:
val_ds
=
_MyDataset
(
self
.
_val_idx
,
self
.
_val_y
,
tokenizer
,
fpath
)
val_ds
=
_MyDataset
(
self
.
_val_idx
,
self
.
_val_y
,
tokenizer
,
fpath
)
val_loader
=
DataLoader
(
val_ds
,
sampler
=
BatchSampler
(
SequentialSampler
(
val_ds
),
batch_size
=
batch_size
,
drop_last
=
False
),
batch_size
=
None
,
pin_memory
=
True
,
num_workers
=
4
val_ds
,
sampler
=
BatchSampler
(
SequentialSampler
(
val_ds
),
batch_size
=
batch_size
,
drop_last
=
False
),
pin_memory
=
True
,
num_workers
=
4
)
return
{
'train_loader'
:
train_loader
,
...
...
@@ -160,7 +160,7 @@ class MyDataset:
ds
=
_MyDataset
(
self
.
data_ids
,
self
.
targets
,
tokenizer
,
fpath
)
loader
=
DataLoader
(
ds
,
sampler
=
BatchSampler
(
SequentialSampler
(
ds
),
batch_size
=
batch_size
,
drop_last
=
False
),
batch_size
=
None
,
pin_memory
=
True
,
num_workers
=
4
ds
,
sampler
=
BatchSampler
(
SequentialSampler
(
ds
),
batch_size
=
batch_size
,
drop_last
=
False
),
pin_memory
=
True
,
num_workers
=
4
)
return
loader
...
...
notebooks/train_evulation_TRX.ipynb
View file @
e8359e0b
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment