CopyPastor

Detecting plagiarism made easy.

Score: 1; Reported for: String similarity Open both answers

Possible Plagiarism

Reposted on 2019-07-20
by guorui

Original Post

Original - Posted on 2019-07-20
by guorui



            
Present in both answers; Present only in the new answer; Present only in the old answer;

Keras + Tensorflow.
Step 1, disable GPU. ``` import os os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID" os.environ["CUDA_VISIBLE_DEVICES"] = "" ``` Step 2, seed those libraries which are included in your code, say "tensorflow, numpy, random". ``` import tensorflow as tf import numpy as np import random as rn
sd = 1 # Here sd means seed. np.random.seed(sd) rn.seed(sd) os.environ['PYTHONHASHSEED']=str(sd)
from keras import backend as K config = tf.ConfigProto(intra_op_parallelism_threads=1,inter_op_parallelism_threads=1) tf.set_random_seed(sd) sess = tf.Session(graph=tf.get_default_graph(), config=config) K.set_session(sess) ``` Make sure these two pieces of code are included at the start of your code, then the result will be reproducible.
Keras + Tensorflow.
Step 1, disable GPU. ``` import os os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID" os.environ["CUDA_VISIBLE_DEVICES"] = "" ``` Step 2, seed those libraries which are included in your code, say "tensorflow, numpy, random". ``` import tensorflow as tf import numpy as np import random as rn
sd = 1 # Here sd means seed. np.random.seed(sd) rn.seed(sd) os.environ['PYTHONHASHSEED']=str(sd)
from keras import backend as K config = tf.ConfigProto(intra_op_parallelism_threads=1,inter_op_parallelism_threads=1) tf.set_random_seed(sd) sess = tf.Session(graph=tf.get_default_graph(), config=config) K.set_session(sess) ``` Make sure these two pieces of code are included at the start of your code, then the result will be reproducible.

        
Present in both answers; Present only in the new answer; Present only in the old answer;