コード例 #1
0
    def __init__(self):
        """Initialize data set and all test cases for assignment.

        Notes:
        * All sizes requested are transposed to account for column matrix as default vector in matlab.
          a4_rand(..) then returns a transposed matrix to have the correct shape.
        """
        super(A4Run, self).__init__()
        data = loadmat(os.path.join(os.getcwd(), 'Data/data.mat'))
        self.data_sets = data['data']

        self.test_rbm_w = self.a4_rand([256, 100], 0) * 2 - 1
        self.small_test_rbm_w = self.a4_rand([256, 10], 0) * 2 - 1

        self.data_1_case = self.sample_bernoulli(self.extract_mini_batch(
            self.data_sets['training'], 0, 1)['inputs'],
                                                 report_calls=False)
        self.data_10_cases = self.sample_bernoulli(self.extract_mini_batch(
            self.data_sets['training'], 99, 10)['inputs'],
                                                   report_calls=False)
        self.data_37_cases = self.sample_bernoulli(self.extract_mini_batch(
            self.data_sets['training'], 199, 37)['inputs'],
                                                   report_calls=False)

        self.test_hidden_state_1_case = self.sample_bernoulli(
            self.a4_rand([1, 100], 0), report_calls=False)
        self.test_hidden_state_10_cases = self.sample_bernoulli(
            self.a4_rand([10, 100], 1), report_calls=False)
        self.test_hidden_state_37_cases = self.sample_bernoulli(
            self.a4_rand([37, 100], 2), report_calls=False)
コード例 #2
0
 def __init__(self):
     """
     Notes:
     * All sizes requested are transposed to account for column matrix as default vector in matlab.
       a4_rand(..) then returns a transposed matrix to have the correct shape.
     """
     a4_randomness_source = loadmat(os.path.join(os.getcwd(), 'Data/a4_randomness_source.mat'))
     self.randomness_source = a4_randomness_source['randomness_source']
コード例 #3
0
 def __init__(self):
     """
     Notes:
     * All sizes requested are transposed to account for column matrix as default vector in matlab.
       a4_rand(..) then returns a transposed matrix to have the correct shape.
     """
     a4_randomness_source = loadmat(
         os.path.join(os.getcwd(), 'Data/a4_randomness_source.mat'))
     self.randomness_source = a4_randomness_source['randomness_source']
コード例 #4
0
    def __init__(self):
        """Initialize data set and all test cases for assignment.

        Notes:
        * All sizes requested are transposed to account for column matrix as default vector in matlab.
          a4_rand(..) then returns a transposed matrix to have the correct shape.
        """
        super(A4Run, self).__init__()
        data = loadmat(os.path.join(os.getcwd(), 'Data/data.mat'))
        self.data_sets = data['data']

        self.test_rbm_w = self.a4_rand([256, 100], 0) * 2 - 1
        self.small_test_rbm_w = self.a4_rand([256, 10], 0) * 2 - 1

        self.data_1_case = self.sample_bernoulli(self.extract_mini_batch(self.data_sets['training'], 0, 1)['inputs'],
                                                 report_calls=False)
        self.data_10_cases = self.sample_bernoulli(self.extract_mini_batch(self.data_sets['training'], 99,
                                                                           10)['inputs'], report_calls=False)
        self.data_37_cases = self.sample_bernoulli(self.extract_mini_batch(self.data_sets['training'], 199,
                                                                           37)['inputs'], report_calls=False)

        self.test_hidden_state_1_case = self.sample_bernoulli(self.a4_rand([1, 100], 0), report_calls=False)
        self.test_hidden_state_10_cases = self.sample_bernoulli(self.a4_rand([10, 100], 1), report_calls=False)
        self.test_hidden_state_37_cases = self.sample_bernoulli(self.a4_rand([37, 100], 2), report_calls=False)
コード例 #5
0
 def __init__(self):
     """Initialize data set and all test cases for assignment.
     """
     data = loadmat(os.path.join(os.getcwd(), 'Data/data.mat'))
     self.data_sets = data['data']
コード例 #6
0
 def __init__(self):
     """Initialize data set and all test cases for assignment.
     """
     data = loadmat(os.path.join(os.getcwd(), 'Data/data.mat'))
     self.data_sets = data['data']