Hello. I have a project to apply FHE on gene expression data (Numpy array of row and columns –https://arep.med.harvard.edu/biclustering/yeast.matrix) and analyze encrypted input data with Biclustering algorithm (like this sample algorithm: biclustlib/cca.py at master · padilha/biclustlib · GitHub). I have read the documentations of Concrete Numpy but I do not know how I should proceed (e.g., defining functions).

Some parts of the algorithms that should be done homomorphically:

```
def _calculate_msr(self, data, rows, cols):
"""Calculate the mean squared residues of the rows, of the columns and of the full data matrix."""
sub_data = data[rows][:, cols]
data_mean = np.mean(sub_data)
row_means = np.mean(sub_data, axis=1)
col_means = np.mean(sub_data, axis=0)
residues = sub_data - row_means[:, np.newaxis] - col_means + data_mean
squared_residues = residues * residues
msr = np.mean(squared_residues)
row_msr = np.mean(squared_residues, axis=1)
col_msr = np.mean(squared_residues, axis=0)
return msr, row_msr, col_msr
def _calculate_msr_col_addition(self, data, rows, cols):
"""Calculate the mean squared residues of the columns for the node addition step."""
sub_data = data[rows][:, cols]
sub_data_rows = data[rows]
data_mean = np.mean(sub_data)
row_means = np.mean(sub_data, axis=1)
col_means = np.mean(sub_data_rows, axis=0)
col_residues = sub_data_rows - row_means[:, np.newaxis] - col_means + data_mean
col_squared_residues = col_residues * col_residues
col_msr = np.mean(col_squared_residues, axis=0)
return col_msr
def _calculate_msr_row_addition(self, data, rows, cols):
"""Calculate the mean squared residues of the rows and of the inverse of the rows for
the node addition step."""
sub_data = data[rows][:, cols]
sub_data_cols = data[:, cols]
data_mean = np.mean(sub_data)
row_means = np.mean(sub_data_cols, axis=1)
col_means = np.mean(sub_data, axis=0)
row_residues = sub_data_cols - row_means[:, np.newaxis] - col_means + data_mean
row_squared_residues = row_residues * row_residues
row_msr = np.mean(row_squared_residues, axis=1)
inverse_residues = -sub_data_cols + row_means[:, np.newaxis] - col_means + data_mean
row_inverse_squared_residues = inverse_residues * inverse_residues
row_inverse_msr = np.mean(row_inverse_squared_residues, axis=1)
return row_msr, row_inverse_msr
```

Any help is greatly appreciated!

I would be happy to provide more detailed information if needed.

Thank you!