AIDE .NET

TensorFlow .NET (Comment ça marche pour les développeurs)

L'apprentissage automatique (ML) a révolutionné diverses industries, de la santé à la finance, en permettant une prise de décision intelligente et une automatisation. TensorFlow, le framework ML et d'apprentissage profond open-source de Google, a été à la pointe de cette révolution. Avec TensorFlow.NET, les développeurs .NET peuvent exploiter la puissance de TensorFlow au sein de l'écosystème C#. Dans cet article, nous explorerons TensorFlow.NET, ses fonctionnalités, ses avantages, et ses applications pratiques dans le développement C#. En outre, nous apprendrons à connaître une bibliothèque de génération de PDF appelée IronPDF de Iron Software avec un exemple pratique.

Comprendre TensorFlow.NET

TensorFlow.NET est une liaison .NET pour TensorFlow, permettant aux développeurs d'utiliser les fonctionnalités de TensorFlow directement au sein des couches d'application C# et .NET. Développé par la communauté et maintenu par l'organisation SciSharp, TensorFlow.NET offre une intégration transparente des capacités d'apprentissage automatique et des réseaux neuronaux de TensorFlow avec la polyvalence de la plateforme .NET. Il permet aux développeurs C# de créer des réseaux neuronaux, d'entraîner des modèles ou des images d'entraînement, et de déployer des modèles d'apprentissage automatique en utilisant les API système et les outils étendus de TensorFlow.

Caractéristiques principales de TensorFlow.NET

  1. Compatibilité TensorFlow : TensorFlow.NET offre une compatibilité totale avec les APIs et opérations de TensorFlow, y compris la manipulation de tenseurs ou l'activation, les couches de réseaux neuronaux, les fonctions de perte, les optimisateurs et les utilitaires pour le prétraitement et l'évaluation des données.

  2. Haute Performance : TensorFlow.NET s'appuie sur le moteur d'exécution graphique de calcul efficace de TensorFlow et les noyaux optimisés pour fournir des inférences et formations d'apprentissage automatique à haute performance sur les CPU et les GPU.

  3. Intégration facile : TensorFlow.NET s'intègre parfaitement avec les applications et bibliothèques .NET existantes, permettant aux développeurs de tirer parti des capacités de TensorFlow sans quitter l'environnement de développement C# familier.

  4. Portabilité du modèle : TensorFlow.NET permet aux développeurs d'importer des modèles TensorFlow pré-entraînés et d'exporter des modèles entraînés pour l'inférence dans d'autres environnements basés sur TensorFlow, tels que Python ou les appareils mobiles.

  5. Flexibilité et Extensibilité : TensorFlow.NET offre une flexibilité pour personnaliser et étendre les modèles d'apprentissage automatique en utilisant les fonctionnalités du langage C#, telles que LINQ (Language Integrated Query) pour la manipulation des données et les paradigmes de programmation fonctionnelle pour la composition de modèles.

  6. Support communautaire et documentation : TensorFlow.NET bénéficie d'une communauté active de contributeurs qui fournissent de la documentation, des tutoriels et des exemples pour aider les développeurs à débuter avec l'apprentissage automatique dans le monde C# en utilisant TensorFlow.

Exemples pratiques avec TensorFlow.NET

Explorons quelques scénarios pratiques où TensorFlow.NET peut être utilisé pour construire et déployer des modèles d'apprentissage automatique en C# :

  1. Chargement et Utilisation de Modèles Pré-entraînés :
    // Load a pre-trained TensorFlow model
    var model = TensorFlowModel.LoadModel("model.pb");
    // Perform inference on input data
    var input = new float[,] { { 1.0f, 2.0f, 3.0f } };
    var output = model.Predict(input);
    // Load a pre-trained TensorFlow model
    var model = TensorFlowModel.LoadModel("model.pb");
    // Perform inference on input data
    var input = new float[,] { { 1.0f, 2.0f, 3.0f } };
    var output = model.Predict(input);
' Load a pre-trained TensorFlow model
	Dim model = TensorFlowModel.LoadModel("model.pb")
	' Perform inference on input data
	Dim input = New Single(, ) {
		{ 1.0F, 2.0F, 3.0F }
	}
	Dim output = model.Predict(input)
$vbLabelText   $csharpLabel
  1. Formation de modèles personnalisés :
    // Create a neural network model using TensorFlow.NET APIs and metrics
    var input = new Input(Shape.Scalar);
    var output = new Dense(1, Activation.ReLU).Forward(input);
    // Compile the model with loss function and optimizer algorithms
    var model = new Model(input, output);
    model.Compile(optimizer: new SGD(), loss: Losses.MeanSquaredError);
    // Train the model with training data just like Python
    model.Fit(x_train, y_train, epochs: 10, batchSize: 32);
    // Create a neural network model using TensorFlow.NET APIs and metrics
    var input = new Input(Shape.Scalar);
    var output = new Dense(1, Activation.ReLU).Forward(input);
    // Compile the model with loss function and optimizer algorithms
    var model = new Model(input, output);
    model.Compile(optimizer: new SGD(), loss: Losses.MeanSquaredError);
    // Train the model with training data just like Python
    model.Fit(x_train, y_train, epochs: 10, batchSize: 32);
IRON VB CONVERTER ERROR developers@ironsoftware.com
$vbLabelText   $csharpLabel
  1. Évaluation et Déploiement :
    // Evaluate the trained model on test data
    var evaluation = model.Evaluate(x_test, y_test);
    // Export the trained model for deployment
    model.SaveModel("trained_model.pb");
    // Evaluate the trained model on test data
    var evaluation = model.Evaluate(x_test, y_test);
    // Export the trained model for deployment
    model.SaveModel("trained_model.pb");
IRON VB CONVERTER ERROR developers@ironsoftware.com
$vbLabelText   $csharpLabel

Plus d'exemples de TensorFlow peuvent être trouvés sur la page Exemples TensorFlow.NET.

// static Tensorflow
using static Tensorflow.Binding;
namespace IronPdfDemos
{
    public class TensorFlow
    {
        public static void Execute()
        {
            var hello = tf.constant("Hello, TensorFlow!");
            Console.WriteLine(hello);
        }
    }
}
// static Tensorflow
using static Tensorflow.Binding;
namespace IronPdfDemos
{
    public class TensorFlow
    {
        public static void Execute()
        {
            var hello = tf.constant("Hello, TensorFlow!");
            Console.WriteLine(hello);
        }
    }
}
' static Tensorflow
Imports Tensorflow.Binding
Namespace IronPdfDemos
	Public Class TensorFlow
		Public Shared Sub Execute()
			Dim hello = tf.constant("Hello, TensorFlow!")
			Console.WriteLine(hello)
		End Sub
	End Class
End Namespace
$vbLabelText   $csharpLabel

Exemple de sortie Hello TensorFlow

TensorFlow .NET (Comment ça fonctionne pour les développeurs) : Figure 1 - Résultat de l'application console

Avantages de l'utilisation de TensorFlow.NET

  1. Intégration transparente : TensorFlow.NET apporte la puissance de TensorFlow à l'écosystème .NET, permettant aux développeurs C# d'exploiter des techniques et des algorithmes d'apprentissage automatique de pointe dans leurs applications.

  2. Performance et évolutivité : TensorFlow.NET utilise le moteur d'exécution optimisé de TensorFlow pour fournir des calculs d'apprentissage automatique à haute performance, ce qui le rend adapté à la gestion de jeux de données à grande échelle, d'images de test et de modèles complexes ou denses.

  3. Environnement de développement familier : l'API TensorFlow.NET permet aux développeurs de créer et de déployer des modèles d'apprentissage automatique en utilisant des caractéristiques du langage C# et des outils de développement familiers, réduisant ainsi la courbe d'apprentissage pour l'adoption de l'apprentissage automatique dans les applications C#.

  4. Interopérabilité et Portabilité : TensorFlow.NET facilite l'interopérabilité avec d'autres environnements basés sur TensorFlow, permettant une intégration transparente des modèles d'apprentissage automatique basés sur C# avec Python, TensorFlow Serving, et TensorFlow Lite.

  5. Développement dirigé par la communauté : TensorFlow.NET bénéficie d'une communauté active de contributeurs et d'utilisateurs qui offrent un soutien, des retours et des contributions au projet, assurant ainsi sa croissance et son amélioration continues.

Licence TensorFlow.NET

Il s'agit d'un logiciel libre sous licence Apache qui peut être utilisé librement. Plus d'informations sur la licence peuvent être lues sur la page TensorFlow.NET License.

Présentation d'IronPDF

TensorFlow .NET (Comment cela fonctionne pour les développeurs) : Figure 2 - IronPDF

IronPDF est une puissante bibliothèque PDF en C# qui permet aux développeurs de créer, modifier et signer des PDFs directement à partir d'entrées HTML, CSS, images et JavaScript. Il s'agit d'une solution commerciale très performante et peu gourmande en mémoire. En voici les principales caractéristiques :

  1. Conversion HTML en PDF : IronPDF peut convertir des fichiers HTML, des chaînes HTML et des URL en PDF. Par exemple, vous pouvez rendre une page web sous forme de PDF à l'aide du moteur de rendu PDF de Chrome.

  2. Prise en charge multiplateforme : IronPDF fonctionne sur diverses plateformes .NET, y compris .NET Core, .NET Standard et .NET Framework. Il est compatible avec Windows, Linux et macOS.

  3. Édition et signature : Vous pouvez définir des propriétés, ajouter des sécurités (mots de passe et autorisations), et même appliquer des signatures numériques à vos PDF.

  4. Modèles de page et paramètres : Personnalisez vos PDFs en ajoutant des en-têtes, des pieds de page, et des numéros de page, ainsi qu'en ajustant les marges. IronPDF prend également en charge les mises en page adaptatives et les formats de papier personnalisés.

  5. Conformité aux normes : IronPDF adhère aux normes PDF telles que PDF/A et PDF/UA. Il prend en charge le codage des caractères UTF-8 et gère les ressources telles que les images, les feuilles de style CSS et les polices.

Générer des documents PDF à l'aide de TensorFlow.NET et IronPDF

Tout d'abord, créez un projet Visual Studio et sélectionnez le modèle Console App ci-dessous.

TensorFlow .NET (Comment ça fonctionne pour les développeurs) : Figure 3 - Projet Visual Studio

Indiquer le nom et la localisation du projet.

TensorFlow .NET (Comment cela fonctionne pour les développeurs) : Figure 4 - Configuration du projet

Sélectionnez la version .NET requise à l'étape suivante et cliquez sur le bouton Créer.

Installez IronPDF à partir du package NuGet depuis le gestionnaire de packages de Visual Studio.

TensorFlow .NET (Comment cela fonctionne pour les développeurs) : Figure 5 - TensorFlow.NET

Installez les packages TensorFlow.NET et TensorFlow.Keras, un package indépendant utilisé pour exécuter des modèles.

TensorFlow .NET (Comment ça fonctionne pour les développeurs) : Figure 6 - Installer le package TensorFlow.Keras

using IronPdf;
using static Tensorflow.Binding;

namespace IronPdfDemos
{
    public class Program
    {
        public static void Main()
        {
            // Instantiate Cache and ChromePdfRenderer
            var renderer = new ChromePdfRenderer();

            // Prepare HTML
            var content = "<h1>Demonstrate TensorFlow with IronPDF</h1>";
            content += $"<p></p>";
            content += $"<h2></h2>";

            // Eager mode
            content += $"<h2>Enable Eager Execution</h2>";
            content += $"<p>tf.enable_eager_execution();</p>";

            // tf is a static TensorFlow instance
            tf.enable_eager_execution(); // Enable eager mode

            content += $"<h2>Define tensor constants.</h2>";
            // Introduce tensor constants
            var a = tf.constant(5);
            var b = tf.constant(6);
            var c = tf.constant(7);

            content += $"<p></p>";
            content += $"<p></p>";
            content += $"<p></p>";

            content += $"<h2>Various tensor operations.</h2>";
            // Various tensor operations usage
            // Note: Tensors also support operators (+, *, ...)
            var add = tf.add(a, b);
            var sub = tf.subtract(a, b);
            var mul = tf.multiply(a, b);
            var div = tf.divide(a, b);

            content += $"<p>var add = tf.add(a, b);</p>";
            content += $"<p>var sub = tf.subtract(a, b);</p>";
            content += $"<p>var mul = tf.multiply(a, b);</p>";
            content += $"<p>var div = tf.divide(a, b);</p>";

            content += $"<h2>Access tensors value.</h2>";
            // Tensors value
            print($"{(int)a} + {(int)b} = {(int)add}");
            print($"{(int)a} - {(int)b} = {(int)sub}");
            print($"{(int)a} * {(int)b} = {(int)mul}");
            print($"{(int)a} / {(int)b} = {(double)div}");

            content += $"<p>{(int)a} + {(int)b} = {(int)add}</p>";
            content += $"<p>{(int)a} - {(int)b} = {(int)sub}</p>";
            content += $"<p>{(int)a} * {(int)b} = {(int)mul}</p>";
            content += $"<p>{(int)a} / {(int)b} = {(double)div}</p>";

            // Some more operations
            var mean = tf.reduce_mean(tf.constant(new[] { a, b, c }));
            var sum = tf.reduce_sum(tf.constant(new[] { a, b, c }));

            content += $"<h2>Access tensors value.</h2>";
            // Access tensors value
            print("mean =", mean.numpy());
            print("sum =", sum.numpy());

            content += $"<p>mean = {mean.numpy()}</p>";
            content += $"<p>sum = {sum.numpy()}</p>";

            content += $"<h2>Matrix multiplications.</h2>";
            // Matrix multiplications with a single row
            var matrix1 = tf.constant(new float[,] { { 1, 2 }, { 3, 4 } });
            var matrix2 = tf.constant(new float[,] { { 5, 6 }, { 7, 8 } });
            var product = tf.matmul(matrix1, matrix2);

            content += "<p>matrix1 = tf.constant(new float[,] { { { 1, 2 }}, { { 3, 4 }} })</p>";
            content += "<p>matrix2 = tf.constant(new float[,] { { { 5, 6 }}, { { 7, 8 }} })</p>";
            content += "<p>product = tf.matmul(matrix1, matrix2)</p>";

            content += $"<h2>Convert Tensor to Numpy.</h2>";
            // Convert Tensor to Numpy
            print("product =", product.numpy());

            content += $"<p>product = {product.numpy()}</p>";

            // Create a PDF from an HTML string using C#
            var pdf = renderer.RenderHtmlAsPdf(content);
            // Export to a file or Stream
            pdf.SaveAs("tensorflow.pdf");
        }
    }
}
using IronPdf;
using static Tensorflow.Binding;

namespace IronPdfDemos
{
    public class Program
    {
        public static void Main()
        {
            // Instantiate Cache and ChromePdfRenderer
            var renderer = new ChromePdfRenderer();

            // Prepare HTML
            var content = "<h1>Demonstrate TensorFlow with IronPDF</h1>";
            content += $"<p></p>";
            content += $"<h2></h2>";

            // Eager mode
            content += $"<h2>Enable Eager Execution</h2>";
            content += $"<p>tf.enable_eager_execution();</p>";

            // tf is a static TensorFlow instance
            tf.enable_eager_execution(); // Enable eager mode

            content += $"<h2>Define tensor constants.</h2>";
            // Introduce tensor constants
            var a = tf.constant(5);
            var b = tf.constant(6);
            var c = tf.constant(7);

            content += $"<p></p>";
            content += $"<p></p>";
            content += $"<p></p>";

            content += $"<h2>Various tensor operations.</h2>";
            // Various tensor operations usage
            // Note: Tensors also support operators (+, *, ...)
            var add = tf.add(a, b);
            var sub = tf.subtract(a, b);
            var mul = tf.multiply(a, b);
            var div = tf.divide(a, b);

            content += $"<p>var add = tf.add(a, b);</p>";
            content += $"<p>var sub = tf.subtract(a, b);</p>";
            content += $"<p>var mul = tf.multiply(a, b);</p>";
            content += $"<p>var div = tf.divide(a, b);</p>";

            content += $"<h2>Access tensors value.</h2>";
            // Tensors value
            print($"{(int)a} + {(int)b} = {(int)add}");
            print($"{(int)a} - {(int)b} = {(int)sub}");
            print($"{(int)a} * {(int)b} = {(int)mul}");
            print($"{(int)a} / {(int)b} = {(double)div}");

            content += $"<p>{(int)a} + {(int)b} = {(int)add}</p>";
            content += $"<p>{(int)a} - {(int)b} = {(int)sub}</p>";
            content += $"<p>{(int)a} * {(int)b} = {(int)mul}</p>";
            content += $"<p>{(int)a} / {(int)b} = {(double)div}</p>";

            // Some more operations
            var mean = tf.reduce_mean(tf.constant(new[] { a, b, c }));
            var sum = tf.reduce_sum(tf.constant(new[] { a, b, c }));

            content += $"<h2>Access tensors value.</h2>";
            // Access tensors value
            print("mean =", mean.numpy());
            print("sum =", sum.numpy());

            content += $"<p>mean = {mean.numpy()}</p>";
            content += $"<p>sum = {sum.numpy()}</p>";

            content += $"<h2>Matrix multiplications.</h2>";
            // Matrix multiplications with a single row
            var matrix1 = tf.constant(new float[,] { { 1, 2 }, { 3, 4 } });
            var matrix2 = tf.constant(new float[,] { { 5, 6 }, { 7, 8 } });
            var product = tf.matmul(matrix1, matrix2);

            content += "<p>matrix1 = tf.constant(new float[,] { { { 1, 2 }}, { { 3, 4 }} })</p>";
            content += "<p>matrix2 = tf.constant(new float[,] { { { 5, 6 }}, { { 7, 8 }} })</p>";
            content += "<p>product = tf.matmul(matrix1, matrix2)</p>";

            content += $"<h2>Convert Tensor to Numpy.</h2>";
            // Convert Tensor to Numpy
            print("product =", product.numpy());

            content += $"<p>product = {product.numpy()}</p>";

            // Create a PDF from an HTML string using C#
            var pdf = renderer.RenderHtmlAsPdf(content);
            // Export to a file or Stream
            pdf.SaveAs("tensorflow.pdf");
        }
    }
}
Imports IronPdf
Imports Tensorflow.Binding

Namespace IronPdfDemos
	Public Class Program
		Public Shared Sub Main()
			' Instantiate Cache and ChromePdfRenderer
			Dim renderer = New ChromePdfRenderer()

			' Prepare HTML
			Dim content = "<h1>Demonstrate TensorFlow with IronPDF</h1>"
			content &= $"<p></p>"
			content &= $"<h2></h2>"

			' Eager mode
			content &= $"<h2>Enable Eager Execution</h2>"
			content &= $"<p>tf.enable_eager_execution();</p>"

			' tf is a static TensorFlow instance
			tf.enable_eager_execution() ' Enable eager mode

			content &= $"<h2>Define tensor constants.</h2>"
			' Introduce tensor constants
			Dim a = tf.constant(5)
			Dim b = tf.constant(6)
			Dim c = tf.constant(7)

			content &= $"<p></p>"
			content &= $"<p></p>"
			content &= $"<p></p>"

			content &= $"<h2>Various tensor operations.</h2>"
			' Various tensor operations usage
			' Note: Tensors also support operators (+, *, ...)
			Dim add = tf.add(a, b)
			Dim [sub] = tf.subtract(a, b)
			Dim mul = tf.multiply(a, b)
			Dim div = tf.divide(a, b)

			content &= $"<p>var add = tf.add(a, b);</p>"
			content &= $"<p>var sub = tf.subtract(a, b);</p>"
			content &= $"<p>var mul = tf.multiply(a, b);</p>"
			content &= $"<p>var div = tf.divide(a, b);</p>"

			content &= $"<h2>Access tensors value.</h2>"
			' Tensors value
			print($"{CInt(a)} + {CInt(b)} = {CInt(add)}")
			print($"{CInt(a)} - {CInt(b)} = {CInt([sub])}")
			print($"{CInt(a)} * {CInt(b)} = {CInt(mul)}")
			print($"{CInt(a)} / {CInt(b)} = {CDbl(div)}")

			content &= $"<p>{CInt(a)} + {CInt(b)} = {CInt(add)}</p>"
			content &= $"<p>{CInt(a)} - {CInt(b)} = {CInt([sub])}</p>"
			content &= $"<p>{CInt(a)} * {CInt(b)} = {CInt(mul)}</p>"
			content &= $"<p>{CInt(a)} / {CInt(b)} = {CDbl(div)}</p>"

			' Some more operations
			Dim mean = tf.reduce_mean(tf.constant( { a, b, c }))
			Dim sum = tf.reduce_sum(tf.constant( { a, b, c }))

			content &= $"<h2>Access tensors value.</h2>"
			' Access tensors value
			print("mean =", mean.numpy())
			print("sum =", sum.numpy())

			content &= $"<p>mean = {mean.numpy()}</p>"
			content &= $"<p>sum = {sum.numpy()}</p>"

			content &= $"<h2>Matrix multiplications.</h2>"
			' Matrix multiplications with a single row
			Dim matrix1 = tf.constant(New Single(, ) {
				{ 1, 2 },
				{ 3, 4 }
			})
			Dim matrix2 = tf.constant(New Single(, ) {
				{ 5, 6 },
				{ 7, 8 }
			})
			Dim product = tf.matmul(matrix1, matrix2)

			content &= "<p>matrix1 = tf.constant(new float[,] { { { 1, 2 }}, { { 3, 4 }} })</p>"
			content &= "<p>matrix2 = tf.constant(new float[,] { { { 5, 6 }}, { { 7, 8 }} })</p>"
			content &= "<p>product = tf.matmul(matrix1, matrix2)</p>"

			content &= $"<h2>Convert Tensor to Numpy.</h2>"
			' Convert Tensor to Numpy
			print("product =", product.numpy())

			content &= $"<p>product = {product.numpy()}</p>"

			' Create a PDF from an HTML string using C#
			Dim pdf = renderer.RenderHtmlAsPdf(content)
			' Export to a file or Stream
			pdf.SaveAs("tensorflow.pdf")
		End Sub
	End Class
End Namespace
$vbLabelText   $csharpLabel

Explication du code

Décortiquons l'extrait de code :

  1. Instructions d'importation :

    Le code commence par importer les bibliothèques nécessaires. En particulier :

    using IronPdf; // This imports the IronPDF package, which is used for working with PDF files.
    using static Tensorflow.Binding; // This imports the TensorFlow library, specifically the .NET standard binding.
    using IronPdf; // This imports the IronPDF package, which is used for working with PDF files.
    using static Tensorflow.Binding; // This imports the TensorFlow library, specifically the .NET standard binding.
IRON VB CONVERTER ERROR developers@ironsoftware.com
$vbLabelText   $csharpLabel
  1. Exécution Eager :

    La ligne tf.enable_eager_execution(); active le mode d'exécution immédiate de TensorFlow. Dans l'exécution impatiente, les opérations sont évaluées immédiatement, ce qui facilite le débogage et l'interaction avec les tenseurs.

  2. Définir des constantes de tenseur :

    Le code définit trois constantes de tenseur : a, b et c. Ils sont initialisés avec les valeurs 5, 6 et 7, respectivement.

  3. Différentes opérations sur les tenseurs :

    Les opérations tensorielles suivantes sont effectuées :

    var add = tf.add(a, b); // Adds a and b.
    var sub = tf.subtract(a, b); // Subtracts b from a.
    var mul = tf.multiply(a, b); // Multiplies a and b.
    var div = tf.divide(a, b); // Divides a by b.
    var add = tf.add(a, b); // Adds a and b.
    var sub = tf.subtract(a, b); // Subtracts b from a.
    var mul = tf.multiply(a, b); // Multiplies a and b.
    var div = tf.divide(a, b); // Divides a by b.
IRON VB CONVERTER ERROR developers@ironsoftware.com
$vbLabelText   $csharpLabel
  1. Accéder aux valeurs de tenseur :

    Les résultats des opérations sur les tenseurs sont imprimés en utilisant la fonction print :

    print($"{(int)a} + {(int)b} = {(int)add}");
    print($"{(int)a} - {(int)b} = {(int)sub}");
    print($"{(int)a} * {(int)b} = {(int)mul}");
    print($"{(int)a} / {(int)b} = {(double)div}");
    print($"{(int)a} + {(int)b} = {(int)add}");
    print($"{(int)a} - {(int)b} = {(int)sub}");
    print($"{(int)a} * {(int)b} = {(int)mul}");
    print($"{(int)a} / {(int)b} = {(double)div}");
IRON VB CONVERTER ERROR developers@ironsoftware.com
$vbLabelText   $csharpLabel

Exemple de sortie :

- 5 + 6 = 11

- 5 - 6 = -1

- 5 * 6 = 30

- 5 / 6 = 0.8333333333333334
  1. Opérations supplémentaires :

    Le code calcule la moyenne et la somme des constantes [a, b, c].

  2. Génération de PDF :

    Le ChromePdfRenderer et le RenderHtmlAsPdf de IronPDF sont utilisés pour rendre la chaîne HTML en un document PDF.

Sortie

TensorFlow .NET (Comment cela fonctionne pour les développeurs) : Figure 7 - Sortie PDF

Licence d'IronPDF

IronPDF nécessite une licence pour fonctionner. Plus d'informations sur les licences peuvent être trouvées sur la page IronPDF Licensing. Placez la clé dans le fichier appSettings.json comme indiqué ci-dessous.

{
  "IronPdf.License.LicenseKey": "The Key Here"
}

Conclusion

En conclusion, TensorFlow.NET permet aux développeurs C# d'explorer le monde de l'apprentissage automatique et de l'intelligence artificielle avec la polyvalence et la productivité de l'écosystème .NET. Que vous créiez des applications intelligentes, des outils d'analytique prédictive ou des systèmes de prise de décision automatisée, TensorFlow.NET offre un cadre puissant et flexible pour libérer le potentiel de l'apprentissage automatique en C#. Avec la bibliothèque IronPDF de Iron Software, les développeurs peuvent acquérir des compétences avancées pour développer des applications modernes.

Chaknith Bin
Ingénieur logiciel
Chaknith travaille sur IronXL et IronBarcode. Il possède une expertise approfondie en C# et .NET, aidant à améliorer le logiciel et à soutenir les clients. Ses idées issues des interactions avec les utilisateurs contribuent à de meilleurs produits, une documentation améliorée et une expérience globale enrichie.
< PRÉCÉDENT
Stripe .NET (Comment ça marche pour les développeurs)
SUIVANT >
Humanizer C# (Comment ça marche pour les développeurs)