Skip to content

Quartus example #667

Answered by bo3z
makoeppel asked this question in Q&A
Discussion options

You must be logged in to vote

Adding to the previous answer - here is an example of a function to convert a model using the Quartus backend and synthesise it:

def convert_to_hls4ml(keras_model, input_data=None, output_data=None, precision='ac_fixed<16, 6, true>', reuse_factor=1):    
    output_dir = r'hls4ml-intel-example'
    hls_config = hls4ml.utils.config_from_keras_model(keras_model, granularity='name', default_precision=precision, default_reuse_factor=reuse_factor)     
    hls_config['Model']['Strategy'] = 'Resource'

    # Device can be Arria10, Stratix10, Agilex, CyloneV, Cyclone10GX etc. - depends on version of Quartus running locally
    hls_model = hls4ml.converters.convert_from_keras_model(
             …

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by vloncar
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants