A computer-implemented method for converting a first computation network of operations arranged to compute a function into a second computation network of Fully Homomorphic Encryption operations arranged to compute the same function, - the first computation network of operations comprising a plurality of real-valued matrix operations ( y = W.x) comprising a real-valued matrix multiplication and at least a plurality of further operations (z = Activation(y)) receiving as input a result of at least one of the plurality of real-valued matrix operations, - converting the first computation network comprises - determining a set of expansion factors ( α i), each of the matrix operations corresponding to an expansion factor of the set of expansion factors, wherein an expansion factor is a real number, - converting a plurality of real-valued matrices corresponding to the plurality of real-valued matrix operations to integer-valued matrices by scaling the real-valued matrices with their corresponding expansion factor and rounding the scaled real-valued matrices, - adjusting the plurality of further operations to receive as input a scaled result of a scaled matrix operation based on an integer-valued matrix of the converted plurality of integer-valued matrices, the second computation network comprising the converted plurality of integer-valued matrices and the adjusted plurality of further operations, - determining an accuracy measure for the second computation network indicating the accuracy of the second computation network, - iteratively optimizing the set of expansion factors ( α i) to improve the accuracy measure. - the first computation network of operations comprising a plurality of real-valued matrix operations ( y = W.x) comprising a real-valued matrix multiplication and at least a plurality of further operations (z = Activation(y)) receiving as input a result of at least one of the plurality of real-valued matrix operations, - converting the first computation network comprises - determining a set of expansion factors ( α i), each of the matrix operations corresponding to an expansion factor of the set of expansion factors, wherein an expansion factor is a real number, - converting a plurality of real-valued matrices corresponding to the plurality of real-valued matrix operations to integer-valued matrices by scaling the real-valued matrices with their corresponding expansion factor and rounding the scaled real-valued matrices, - adjusting the plurality of further operations to receive as input a scaled result of a scaled matrix operation based on an integer-valued matrix of the converted plurality of integer-valued matrices, the second computation network comprising the converted plurality of integer-valued matrices and the adjusted plurality of further operations, - determining an accuracy measure for the second computation network indicating the accuracy of the second computation network, - iteratively optimizing the set of expansion factors ( α i) to improve the accuracy measure. - determining a set of expansion factors ( α i), each of the matrix operations corresponding to an expansion factor of the set of expansion factors, wherein an expansion factor is a real number, - converting a plurality of real-valued matrices corresponding to the plurality of real-valued matrix operations to integer-valued matrices by scaling the real-valued matrices with their corresponding expansion factor and rounding the scaled real-valued matrices, - adjusting the plurality of further operations to receive as input a scaled result of a scaled matrix operation based on an integer-valued matrix of the converted plurality of integer-valued matrices, the second computation network comprising the converted plurality of integer-valued matrices and the adjusted plurality of further operations, - determining an accuracy measure for the second computation network indicating the accuracy of the second computation network, - iteratively optimizing the set of expansion factors ( α i) to improve the accuracy measure.