Skip to content
GitLab
Explorer
Connexion
S'inscrire
Navigation principale
Rechercher ou aller à…
Projet
M
ModelCIMs_framework
Gestion
Activité
Membres
Labels
Programmation
Wiki
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Compilation
Pipelines
Jobs
Planifications de pipeline
Artéfacts
Déploiement
Releases
Registre de paquets
Registre de conteneur
Registre de modèles
Opération
Modules Terraform
Analyse
Données d'analyse des chaînes de valeur
Analyse des contributeurs
Données d'analyse CI/CD
Données d'analyse du dépôt
Expériences du modèle
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté
Contribuer à GitLab
Donner votre avis
Conditions générales et politique de confidentialité
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
Adrian Kneip
ModelCIMs_framework
Validations
2ef3acd5
Valider
2ef3acd5
rédigé
2 years ago
par
Adrian Kneip
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
Upload New File
parent
248d7c72
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Modifications
1
Masquer les modifications d'espaces
En ligne
Côte à côte
Affichage de
1 fichier modifié
my_datasets/my_cifar10.py
+63
-0
63 ajouts, 0 suppression
my_datasets/my_cifar10.py
avec
63 ajouts
et
0 suppression
my_datasets/my_cifar10.py
0 → 100644
+
63
−
0
Voir le fichier @
2ef3acd5
# Copyright 2015 The TensorFlow Authors. 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,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""
CIFAR10 small images classification dataset.
"""
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
print_function
import
os
import
numpy
as
np
from
keras
import
backend
as
K
from
keras.datasets.cifar
import
load_batch
from
keras.utils.data_utils
import
get_file
from
tensorflow.python.util.tf_export
import
tf_export
#@tf_export('keras.datasets.cifar10.load_data')
def
load_data
():
"""
Loads CIFAR10 dataset.
Returns:
Tuple of Numpy arrays: `(x_train, y_train), (x_test, y_test)`.
"""
dirname
=
'
cifar-10-batches-py
'
origin
=
'
./
'
#path = get_file(dirname, origin=origin, untar=True)
path
=
'
/export/home/adkneip/Documents/PhD/Python3/IMC_Modeling/qnn/my_datasets/cifar-10-batches-py
'
;
num_train_samples
=
50000
x_train
=
np
.
empty
((
num_train_samples
,
3
,
32
,
32
),
dtype
=
'
uint8
'
)
y_train
=
np
.
empty
((
num_train_samples
,),
dtype
=
'
uint8
'
)
for
i
in
range
(
1
,
6
):
fpath
=
os
.
path
.
join
(
path
,
'
data_batch_
'
+
str
(
i
))
(
x_train
[(
i
-
1
)
*
10000
:
i
*
10000
,
:,
:,
:],
y_train
[(
i
-
1
)
*
10000
:
i
*
10000
])
=
load_batch
(
fpath
)
fpath
=
os
.
path
.
join
(
path
,
'
test_batch
'
)
x_test
,
y_test
=
load_batch
(
fpath
)
y_train
=
np
.
reshape
(
y_train
,
(
len
(
y_train
),
1
))
y_test
=
np
.
reshape
(
y_test
,
(
len
(
y_test
),
1
))
if
K
.
image_data_format
()
==
'
channels_last
'
:
x_train
=
x_train
.
transpose
(
0
,
2
,
3
,
1
)
x_test
=
x_test
.
transpose
(
0
,
2
,
3
,
1
)
return
(
x_train
,
y_train
),
(
x_test
,
y_test
)
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter