WO2022135592A1 - 模型训练程序镜像的生成方法、装置、设备及存储介质 - Google Patents

模型训练程序镜像的生成方法、装置、设备及存储介质 Download PDF

Info

Publication number
WO2022135592A1
WO2022135592A1 PCT/CN2021/141366 CN2021141366W WO2022135592A1 WO 2022135592 A1 WO2022135592 A1 WO 2022135592A1 CN 2021141366 W CN2021141366 W CN 2021141366W WO 2022135592 A1 WO2022135592 A1 WO 2022135592A1
Authority
WO
WIPO (PCT)
Prior art keywords
model training
file
training program
generating
files
Prior art date
Application number
PCT/CN2021/141366
Other languages
English (en)
French (fr)
Inventor
赵庆
郭朕
张宇
罗伟锋
Original Assignee
第四范式(北京)技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 第四范式(北京)技术有限公司 filed Critical 第四范式(北京)技术有限公司
Publication of WO2022135592A1 publication Critical patent/WO2022135592A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45562Creating, deleting, cloning virtual machine instances
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Definitions

  • the embodiments of the present disclosure relate to the technical field of machine learning, and in particular, to a method, apparatus, device, and storage medium for generating a model training program image.
  • the machine learning field has a unified format specification for models: Open Neural Network Exchange (ONNX), but the model training program lacks a unified format specification.
  • ONNX Open Neural Network Exchange
  • the model training program lacks a unified format specification.
  • model training programs are difficult to transfer to different machine learning platforms.
  • there is no effective model training program packaging and distribution mechanism so the model training program cannot be shared for other developers to use.
  • each model training program lacks an effective way to solve the problems of labeling, usage documentation, program dependencies, storage, distribution and sharing at the same time.
  • At least one embodiment of the present disclosure provides a method, apparatus, device, and storage medium for generating a model training program image.
  • an embodiment of the present disclosure provides a method for generating a model training program image, including:
  • description file includes: description information of the configuration file, description information of the one or more first-layer files, and description information of the one or more second-layer files;
  • a model training program image is generated, and the model training program image includes the description file, the configuration file, the one or more first layer files and the one or more second layer files.
  • the model training program file is an executable file of the model training program
  • the generating one or more first layer files based on the model training program file includes: generating one first layer file based on the executable file.
  • the model training program file is a source code file and a dependency file of the model training program; wherein, the dependency file includes: one or more files that the model training program depends on during the training process;
  • the generating one or more first-layer files based on the model training program file includes: generating one first-layer file based on the source code file; and generating one or more first-layer files based on the dependency file.
  • the data set includes test data and/or training data
  • the generating one or more second layer files based on the data set includes: generating one or more second layer files for the test data; and generating one or more second layer files for the training data.
  • the configuration information of the model training program includes: scenarios, parameter definitions and calling methods; the configuration file includes a plurality of fields;
  • the generating a configuration file based on the configuration information of the model training program includes:
  • the configuration information of the model training program further includes: information of the project to which the model training program belongs and the address of the project in the source code management warehouse;
  • the generating a configuration file based on the configuration information of the model training program further includes:
  • the information of the project to which the model training program belongs and the address of the project in the source code management repository are written into the same field or different fields of the plurality of fields.
  • the configuration information of the model training program further includes: text information of the instruction for using the model training program;
  • the generating a configuration file based on the configuration information of the model training program further includes:
  • the method further includes:
  • the description file further includes: description information of the one or more third-level files; and the model training program image further includes the one or more third-level files.
  • the generating a model training program image includes:
  • the description file, the configuration file, the one or more first-layer files, and the one or more second-layer files are packaged into a model training program image.
  • the configuration information of the model training program is defined in the model training program file
  • acquiring the configuration information of the model training program includes: parsing the model training program file to obtain the configuration information of the model training program.
  • an embodiment of the present disclosure further provides an apparatus for generating a model training program image, including:
  • the acquisition unit is used to acquire the model training program file, the data set and the configuration information of the model training program;
  • a file generation unit configured to generate one or more first-layer files based on the model training program file; generate one or more second-layer files based on the data set; generate a configuration file based on the configuration information of the model training program ; Generate a description file, the description file includes: the description information of the configuration file, the description information of the one or more first layer files and the description information of the one or more second layer files;
  • an image generation unit configured to generate a model training program image, where the model training program image includes the description file, the configuration file, the one or more first layer files and the one or more second layer files document.
  • the model training program file is an executable file of the model training program
  • the file generating unit generating one or more first layer files based on the model training program file includes: generating one first layer file based on the executable file.
  • the model training program file is a source code file and a dependency file of the model training program; wherein, the dependency file includes: one or more files that the model training program depends on during the training process;
  • the file generation unit generating one or more first layer files based on the model training program file includes: generating one first layer file based on the source code file; generating one or more first layer files based on the dependency file .
  • the data set includes test data and/or training data
  • the file generating unit generating one or more second layer files based on the data set includes: generating one or more second layer files for the test data; generating one or more second layer files for the training data .
  • the configuration information of the model training program includes: a scenario, a parameter definition, and a calling device; the configuration file includes a plurality of fields;
  • the file generation unit generating a configuration file based on the configuration information of the model training program includes:
  • the configuration information of the model training program further includes: information of the project to which the model training program belongs and the address of the project in the source code management warehouse;
  • the file generating unit generating a configuration file based on the configuration information of the model training program further includes: writing the information of the project to which the model training program belongs and the address of the project in the source code management warehouse into the plurality of fields. Same field or different fields.
  • the configuration information of the model training program further includes: text information of the instruction for using the model training program;
  • the file generating unit generating a configuration file based on the configuration information of the model training program further includes: writing the text information into one of the plurality of fields.
  • the obtaining unit is further configured to obtain a file of the instruction for use of the model training program;
  • the file generating unit is further configured to generate one or more third-level files based on the file of the instruction for use of the model training program;
  • the description file further includes: description information of the one or more third-level files; and the model training program image further includes the one or more third-level files.
  • the image generation unit is used to:
  • the description file, the configuration file, the one or more first-layer files, and the one or more second-layer files are packaged into a model training program image.
  • the configuration information of the model training program is defined in the model training program file
  • the acquiring unit acquiring the configuration information of the model training program includes: parsing the model training program file to obtain the configuration information of the model training program.
  • an embodiment of the present disclosure further provides an electronic device, including: a processor and a memory; the processor is configured to execute the method described in any embodiment of the first aspect by invoking a program or an instruction stored in the memory. steps of the method.
  • an embodiment of the present disclosure further provides a non-transitory computer-readable storage medium for storing a program or an instruction, where the program or instruction causes a computer to execute the steps of the method according to any embodiment of the first aspect.
  • the generation layer file, configuration file and description file are generated as the image of the model training program, which realizes the unified packaging format specification of the model training program, and facilitates the migration, training and use of the model training program on various machine learning platforms.
  • the model training program image is packaged into an image by extending the Open Container Initiative (OCI), which can solve the problems of unification of packaging formats, program dependencies, and usage instructions at the same time. , labels, etc.
  • OCI Open Container Initiative
  • the distribution and sharing of the model training program is completed with the help of a large number of existing OCI mirror storage facilities, which solves the problem that it is difficult to distribute and share the model training program at present.
  • FIG. 1 is an exemplary flowchart of a method for generating a model training program image provided by an embodiment of the present disclosure
  • FIG. 2 is an exemplary block diagram of an apparatus for generating a model training program image provided by an embodiment of the present disclosure
  • FIG. 3 is an exemplary block diagram of an electronic device provided by an embodiment of the present disclosure.
  • the embodiment of the present disclosure provides a method for generating a model training program image, which is based on the model training program file and The dataset generates different layer files, and generates configuration files based on the configuration information, and then generates description files for describing these layer files and configuration files, so that the generated layer files, configuration files, and description files are generated as model training program images.
  • the unified packaging format specification of the model training program is realized, which is convenient for the model training program to be migrated, trained, and used on various machine learning platforms.
  • the model training program cannot be shared for other developers to use, and the current model training program lacks an effective way to solve the problem of labeling, usage documentation, Problems such as program dependency, storage distribution and sharing, etc.
  • the model training program image is packaged into an image by extending the Open Container Initiative (OCI), which can solve the problem of uniform packaging format and program dependency at the same time. , instructions for use, labels, etc.
  • OCI Open Container Initiative
  • the distribution and sharing of the model training program is completed with the help of a large number of existing OCI mirror storage facilities, which solves the problem that it is difficult to distribute and share the model training program at present.
  • FIG. 1 is an exemplary flowchart of a method for generating a model training program image according to an embodiment of the present disclosure.
  • the execution body of the method is an electronic device, and the electronic device can be understood as a device in the machine learning platform, and the electronic device can also be a device independent of the machine learning platform.
  • the electronic device may be a mobile device such as a smart phone, a tablet computer, a notebook computer, etc., or a fixed device such as a personal desktop computer and a server, wherein the server may be a single server, or a server group, a server Groups can be centralized or distributed.
  • an electronic device is used as an execution body to describe the flow of a method for generating a model training program image.
  • the electronic device acquires the model training program file, the data set and the configuration information of the model training program.
  • the dataset may include training data for training the model and test data for testing the model.
  • the model training program may train the model based on the training data, and test the trained model based on the test data.
  • the electronic device may provide a User Interface (UI), so that the user may input configuration information of the model training program through the UI.
  • UI User Interface
  • model training program files and/or datasets may be obtained locally or remotely via a network.
  • configuration information for the model trainer may be defined in a model trainer file.
  • obtaining the configuration information of the model training program by the electronic device includes: parsing the model training program file to obtain the configuration information of the model training program.
  • the electronic device may also obtain a file of instructions for use of the model training program.
  • the file of the model training program usage instructions can be an image or a document.
  • the electronic device In step 102, the electronic device generates one or more first layer files based on the model training program file.
  • the definition of the layer file is borrowed from the definition of the layer file in the container image standard, which is not repeated here.
  • the container image standard is, for example, the container image standard (Image Spec) in the OCI standard. This embodiment extends the Layer in the container image standard.
  • the model training program file is an executable file
  • the operating system in the machine learning platform can directly load and execute the executable file.
  • the electronic device uses a Layer to place the executable file. Specifically, the electronic device generates a first-layer file based on the executable file.
  • the model training program files are source code files and dependent files of the model training program, wherein the dependent files include: one or more files that the model training program depends on during the training process.
  • the electronic device generates one first layer file based on the source code file, and generates one or more first layer files based on the dependency files, wherein the number of the first layer files generated based on the dependency files depends on the dependency The number of subfiles included in the file.
  • the electronic device uses one Layer to place source code files, and uses one or more Layers to place dependent files.
  • each sub-file can be placed in a different Layer, or some sub-files can be placed in the same Layer, or all sub-files can be placed in the same Layer .
  • the electronic device In step 103, the electronic device generates one or more second layer files based on the data set. This embodiment extends the Layer in the container image standard. In some embodiments, based on the data set including test data and training data, the electronic device generates one or more second layer files for the test data and one or more second layer files for the training data. In this embodiment, the electronic device uses one or more layers to store test data and training data, respectively, and the number of layers can be determined based on the amount of data.
  • the electronic device may generate one or more third-level files based on the acquired files of the model training program usage instructions.
  • This embodiment extends the Layer in the container image standard. For example, if the file used by the model training program is a document, the electronic device can place the document in a Layer. Specifically, the electronic device generates a third-layer file based on the document.
  • the file of the instruction of the model training program includes multiple pictures, then the electronic device generates one or more files of the third layer based on the multiple pictures, wherein the number of the files of the third layer depends on the instruction of the instruction of the model training program. The number of pictures included in the file.
  • the file of the instruction for use of the model training program includes multiple pictures, and each picture can be placed in a different layer, or, some pictures can be placed in the same layer, or all pictures can be placed in the same layer Layer.
  • the electronic device In step 104, the electronic device generates a configuration file based on the configuration information of the model training program.
  • the configuration file is similar to the Config file in the container image standard. This embodiment extends the Config file in the container image standard.
  • the configuration information of the model training program may include, but is not limited to, scenarios, parameter definitions, and invocation methods. Among them, the scene is related to the problem to be solved by machine learning.
  • the problem to be solved by machine learning is a binary classification problem, specifically, according to the features extracted from the data samples, it is determined which one of the limited categories it belongs to. For example: spam identification (result category: 1, spam; 2, normal mail), then the scene is a spam classification scene.
  • a result of a continuous value is predicted according to the features extracted from the data samples. For example: the box office prediction of a certain movie, then the scene is the box office prediction scene.
  • the problem to be solved by machine learning is a clustering problem
  • the samples are grouped together (ie, similar/related samples are grouped together). For example: news classification, then the scene is a news clustering scene.
  • the configuration file generated by the electronic device includes a plurality of fields.
  • the electronic device can write the scene in the configuration information into a field.
  • the electronic device can write the scene in the configuration information into a label field, where the label field is similar to the label field in the Config file.
  • the electronic device can write parameter definitions and calling methods in the configuration information into the same field or different fields.
  • the electronic device may write the parameter definition and the calling method into the same field: the meta field.
  • the meta field is similar to the meta field in the Config file, but the content written is different.
  • relevant information of the model training program may also be written in the meta field, for example, the relevant information is text information, where the text information is text information of the usage description of the model training program, used to describe how the model training program is used.
  • the configuration information of the model training program may further include, but is not limited to, information about the project to which the model training program belongs and the address of the project in the source code management repository.
  • the information of the project to which the model training program belongs is, for example, the project homepage, and the address of the project in the source code management warehouse is, for example, a Github address.
  • the electronic device may write the information of the project to which the model training program belongs and the address of the project in the source code management repository into the same field or different fields in the multiple fields of the configuration file.
  • the electronic device may write the information of the project to which the model training program belongs and the address of the project in the source code management repository into the meta field.
  • the configuration information of the model training program may further include, but is not limited to: text information of the usage instructions of the model training program.
  • the electronic device may write the text information into one of the fields of the configuration file, for example, the meta field.
  • the fields of the configuration file include an annotation field, wherein the annotation field is similar to the annotation field in the Config file.
  • the electronic device can write annotation information, remark information and other information in the annotation field to facilitate the user to understand the model training program.
  • the multiple fields of the configuration file may further include related fields of the mirror creation information, such as an author field, a creation time field, and the like.
  • information such as annotation information, remark information, etc. to facilitate the user to understand the model training program may be defined in the model training program file.
  • the electronic device can parse the model training program file, obtain annotation information, remark information, etc., and then write the information into the annotation field.
  • the electronic device In step 105, the electronic device generates a description file, and the description file includes: description information of the configuration file, description information of one or more first-layer files, and description information of one or more second-layer files.
  • the description file generated by the electronic device further includes: the description file of one or more third-level files. Description.
  • the description file is similar to the manifest file in the container image standard.
  • the electronic device In step 106, the electronic device generates a model training program image, and the model training program image includes a description file, a configuration file, one or more first-layer files and one or more second-layer files. In some embodiments, if the electronic device generates one or more third-layer files based on the obtained file of the model training program usage instructions, the model training program image generated by the electronic device further includes: one or more third-layer files document.
  • the electronic device packages a description file, a configuration file, one or more first-layer files, and one or more second-layer files into a model training program image based on a container image standard. In some embodiments, if the electronic device generates one or more third-layer files based on the obtained file of the model training program usage description, the electronic device generates the description file, configuration file, one or more third-level files based on the container image standard One layer file, one or more second layer files, and one or more third layer files are packaged as a model trainer image.
  • the image of the model training program is an image packaged with a unified packaging format specification, which facilitates the migration, training, and use of the model training program on various machine learning platforms, so as to achieve the goal of "writing at one place and training everywhere".
  • model training program image is an image formed by packaging the model training program by extending the Open Container Initiative (OCI).
  • OCI Open Container Initiative
  • at least one embodiment of the present disclosure extends the Config file and Layer in the OCI standard. At the same time, it can solve the problems of unified packaging format, program dependencies, instructions for use, labels and so on.
  • the distribution and sharing of the model training program is completed with the help of a large number of existing OCI mirror storage facilities, which solves the problem that it is difficult to distribute and share the model training program at present.
  • the electronic device can complete the creation of the model training program image through a command line tool similar to Docker Build.
  • the model training program image is fully compatible with the application container engine (Docker) image, and can be used directly as a Docker image, which is easy to use, and can also be distributed and stored as an ordinary Docker image.
  • Docker application container engine
  • FIG. 2 is an exemplary block diagram of an apparatus for generating a model training program image according to an embodiment of the present disclosure.
  • the generating device may include, but is not limited to, an acquiring unit 21 , a file generating unit 22 and an image generating unit 23 .
  • the details of each unit are as follows:
  • Obtaining unit 21 is used to obtain the configuration information of the model training program file, the data set and the model training program;
  • the file generation unit 22 is used to generate one or more first-level files based on the model training program file; generate one or more second-level files based on the data set; generate a configuration file based on the configuration information of the model training program; generate a description file,
  • the description file includes: the description information of the configuration file, the description information of one or more first-level files, and the description information of one or more second-level files;
  • the image generating unit 23 is configured to generate a model training program image, and the model training program image includes a description file, a configuration file, one or more first-layer files and one or more second-layer files.
  • the model training program file is an executable file of the model training program
  • the file generation unit 22 generating one or more first-level files based on the model training program file includes: generating one first-level file based on the executable file.
  • the model training program files are source code files and dependent files of the model training program; wherein, the dependent files include: one or more files that the model training program depends on during the training process;
  • the file generation unit 22 generates one or more first-level files based on the model training program file, including: generating one first-level file based on the source code file; and generating one or more first-level files based on the dependency file.
  • the dataset includes test data and/or training data
  • the file generating unit 22 generates one or more second-layer files based on the data set, including: generating one or more second-layer files for test data; and generating one or more second-layer files for training data.
  • the configuration information of the model training program includes: scenarios, parameter definitions and invocation means; the configuration file includes a plurality of fields;
  • the file generation unit 22 generates a configuration file based on the configuration information of the model training program, including:
  • the configuration information of the model training program further includes: information of the project to which the model training program belongs and the address of the project in the source code management repository;
  • the file generating unit 22 generating the configuration file based on the configuration information of the model training program further includes: writing the information of the project to which the model training program belongs and the address of the project in the source code management repository into the same field or different fields among the multiple fields.
  • the configuration information of the model training program further includes: text information of the instruction for using the model training program;
  • the file generating unit 22 generating the configuration file based on the configuration information of the model training program further includes: writing text information into one of the plurality of fields.
  • the obtaining unit 21 is further configured to obtain the file of the instruction for use of the model training program
  • the file generation unit 22 is further configured to generate one or more third-level files based on the files of the model training program usage instructions;
  • the description file further includes: description information of one or more third-level files; and the model training program image further includes one or more third-level files.
  • the image generation unit 23 is used to:
  • a description file, a configuration file, one or more first-layer files, and one or more second-layer files are packaged into a model training program image.
  • the configuration information of the model training program is defined in the model training program file
  • obtaining the configuration information of the model training program by the obtaining unit 21 includes: parsing the model training program file to obtain the configuration information of the model training program.
  • each unit in the apparatus for generating a model training program image is only a logical function division, and there may be other division methods in actual implementation, for example, multiple units may be implemented as one unit; A unit is divided into subunits. It can be understood that each unit or sub-unit can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods for implementing the described functionality for each particular application.
  • FIG. 3 is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure.
  • the electronic device includes: at least one processor 31 , at least one memory 32 and at least one communication interface 33 .
  • the various components in the electronic device are coupled together by a bus system 34 .
  • the communication interface 33 is used for information transmission with external devices. Understandably, the bus system 34 is used to implement the connection communication between these components.
  • the bus system 34 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, the various buses are designated as bus system 34 in FIG. 3 .
  • the memory 32 in this embodiment may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memory.
  • memory 32 stores the following elements, executable units or data structures, or subsets thereof, or extended sets of them: operating systems and applications.
  • the operating system includes various system programs, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic tasks and processing hardware-based tasks.
  • Applications including various applications, such as media players (Media Player), browsers (Browser), etc., are used to implement various application tasks.
  • a program for implementing the method for generating a model training program image provided by the embodiment of the present disclosure may be included in an application program.
  • the processor 31 calls the program or instruction stored in the memory 32, specifically, the program or instruction stored in the application program, and the processor 31 is configured to execute the model training program image provided by the embodiment of the present disclosure. The steps of each embodiment of the generation method.
  • the method for generating a model training program image may be applied to the processor 31 or implemented by the processor 31 .
  • the processor 31 may be an integrated circuit chip, which has signal processing capability. In the implementation process, each step of the above-mentioned method can be completed by a hardware integrated logic circuit in the processor 31 or an instruction in the form of software.
  • the above-mentioned processor 31 can be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a ready-made programmable gate array (Field Programmable Gate Array, FPGA) or other Programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
  • a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
  • the steps of the method for generating a model training program image provided by the embodiments of the present disclosure can be directly embodied as being executed by a hardware decoding processor, or executed by a combination of hardware and software units in the decoding processor.
  • the software unit may be located in random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers and other storage media mature in the art.
  • the storage medium is located in the memory 32, and the processor 31 reads the information in the memory 32 and completes the steps of the method in combination with its hardware.
  • Embodiments of the present disclosure also provide a non-transitory computer-readable storage medium, where the non-transitory computer-readable storage medium stores programs or instructions, and the programs or instructions cause a computer to execute various implementations of the method for generating an image of a model training program image.
  • the steps of the example, in order to avoid repeated description, will not be repeated here.
  • a description file for describing these layer files and configuration files can be generated, so that the The generation layer file, configuration file and description file are generated as the image of the model training program, which realizes the unified packaging format specification of the model training program, and facilitates the migration, training, and use of the model training program on various machine learning platforms.
  • the model training program image is packaged into an image by extending the Open Container Initiative (OCI), which can solve the problems of unification of packaging formats, program dependencies, and usage instructions at the same time. , labels, etc.
  • OCI Open Container Initiative
  • the distribution and sharing of the model training program is completed with the help of a large number of existing OCI mirror storage facilities, which solves the problem that it is difficult to distribute and share the model training program at present.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

一种模型训练程序镜像的生成方法、装置、设备及存储介质。方法包括:获取模型训练程序文件、数据集和模型训练程序的配置信息(101);基于模型训练程序文件生成一个或多个第一层文件(102);基于数据集生成一个或多个第二层文件(103);基于模型训练程序的配置信息生成配置文件(104);生成描述文件,描述文件中包括:所述配置文件的描述信息、所述一个或多个第一层文件的描述信息和所述一个或多个第二层文件的描述信息(105);生成模型训练程序镜像,所述模型训练程序镜像中包括所述描述文件、所述配置文件、所述一个或多个第一层文件和所述一个或多个第二层文件(106)。实现了模型训练程序的统一打包格式规范,便于模型训练程序在各个机器学习平台进行迁移、训练、使用等。

Description

模型训练程序镜像的生成方法、装置、设备及存储介质
本公开要求于2020年12月24日提交中国专利局、申请号为202011553757.5、发明名称为“模型训练程序镜像的生成方法、装置、设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本公开中。
技术领域
本公开实施例涉及机器学习技术领域,具体涉及一种模型训练程序镜像的生成方法、装置、设备及存储介质。
背景技术
机器学***台,每个平台有各自的模型训练程序的定义规范。
因为缺乏统一的格式规范,模型训练程序很难迁移到不同的机器学习平台上。同时缺乏有效的模型训练程序打包和分发机制,从而也不能将模型训练程序共享出来供其他开发者使用。另外,各个模型训练程序缺乏有效的方式同时解决注明标签、使用说明文档、程序依赖、存储分发共享等问题。
上述对问题的发现过程的描述,仅用于辅助理解本公开的技术方案,并不代表承认上述内容是现有技术。
发明内容
为了解决现有技术存在的至少一个问题,本公开的至少一个实施例提供了一种模型训练程序镜像的生成方法、装置、设备及存储介质。
第一方面,本公开实施例提出一种模型训练程序镜像的生成方法,包括:
获取模型训练程序文件、数据集和模型训练程序的配置信息;
基于所述模型训练程序文件生成一个或多个第一层文件;
基于所述数据集生成一个或多个第二层文件;
基于所述模型训练程序的配置信息生成配置文件;
生成描述文件,所述描述文件中包括:所述配置文件的描述信息、所述一个或多个第一层文件的描述信息和所述一个或多个第二层文件的描述信息;
生成模型训练程序镜像,所述模型训练程序镜像中包括所述描述文件、所述配置文件、所述一个或多个第一层文件和所述一个或多个第二层文件。
在一些实施例中,所述模型训练程序文件为模型训练程序的可执行文件;
所述基于所述模型训练程序文件生成一个或多个第一层文件包括:基于所述可执行文件生成一个第一层文件。
在一些实施例中,所述模型训练程序文件为模型训练程序的源代码文件和依赖文件;其中,所述依赖文件包括:所述模型训练程序在训练过程中所依赖的一个或多个文件;
所述基于所述模型训练程序文件生成一个或多个第一层文件包括:基于所述源代码文件生成一个第一层文件;基于所述依赖文件生成一个或多个第一层文件。
在一些实施例中,所述数据集中包括测试数据和/或训练数据;
所述基于所述数据集生成一个或多个第二层文件包括:针对所述测试数据生成一个或多个第二层文件;针对所述训练数据生成一个或多个第二层文件。
在一些实施例中,所述模型训练程序的配置信息包括:场景、参数定义和调用方法;所述配置文件包括多个字段;
所述基于所述模型训练程序的配置信息生成配置文件包括:
将所述场景写入所述多个字段中的一个字段;
将所述参数定义和所述调用方法写入所述多个字段中的相同字段或不同字段。
在一些实施例中,所述模型训练程序的配置信息还包括:模型训练程序所属项目的信息和所属项目在源代码管理仓库中的地址;
所述基于所述模型训练程序的配置信息生成配置文件还包括:
将所述模型训练程序所属项目的信息和所属项目在源代码管理仓库中的地址写入所述多个字段中的相同字段或不同字段。
在一些实施例中,所述模型训练程序的配置信息还包括:模型训练程序使用说明的文本信息;
所述基于所述模型训练程序的配置信息生成配置文件还包括:
将所述文本信息写入所述多个字段中的一个字段。
在一些实施例中,所述方法还包括:
获取模型训练程序使用说明的文件;
基于所述模型训练程序使用说明的文件生成一个或多个第三层文件;
相应地,所述描述文件中还包括:所述一个或多个第三层文件的描述信息;所述模型训练程序镜像中还包括所述一个或多个第三层文件。
在一些实施例中,所述生成模型训练程序镜像包括:
基于容器镜像标准,将所述描述文件、所述配置文件、所述一个或多个第一层文件和所述一个或多个第二层文件打包为模型训练程序镜像。
在一些实施例中,所述模型训练程序的配置信息定义在所述模型训练程序文件中;
相应地,获取所述模型训练程序的配置信息包括:解析所述模型训练程序文件,得到所述模型训练程序的配置信息。
第二方面,本公开实施例还提出一种模型训练程序镜像的生成装置,包括:
获取单元,用于获取模型训练程序文件、数据集和模型训练程序的配置信息;
文件生成单元,用于基于所述模型训练程序文件生成一个或多个第一层文件;基于所述数据集生成一个或多个第二层文件;基于所述模型训练程序的配置信息生成配置文件;生成描述文件,所述描述文件中包括:所述配置文件的描述信息、所述一个或多个第一层文件的描述信息和所述一个或多个第二层文件的描述信息;
镜像生成单元,用于生成模型训练程序镜像,所述模型训练程序镜像中包括所述描述文件、所述配置文件、所述一个或多个第一层文件和所述一个或多个第二层文件。
在一些实施例中,所述模型训练程序文件为模型训练程序的可执行文件;
所述文件生成单元基于所述模型训练程序文件生成一个或多个第一层文件包括:基于所述可执行文件生成一个第一层文件。
在一些实施例中,所述模型训练程序文件为模型训练程序的源代码文件和依赖文件;其中,所述依赖文件包括:所述模型训练程序在训练过程中所依赖的一个或多个文件;
所述文件生成单元基于所述模型训练程序文件生成一个或多个第一层文件包括:基于所述源代码文件生成一个第一层文件;基于所述依赖文件生成一个或多个第一层文件。
在一些实施例中,所述数据集中包括测试数据和/或训练数据;
所述文件生成单元基于所述数据集生成一个或多个第二层文件包括:针对所述测试数据生成一个或多个第二层文件;针对所述训练数据生成一个或多个第二层文件。
在一些实施例中,所述模型训练程序的配置信息包括:场景、参数定义和调用装置;所述配置文件包括多个字段;
所述文件生成单元基于所述模型训练程序的配置信息生成配置文件包括:
将所述场景写入所述多个字段中的一个字段;
将所述参数定义和所述调用装置写入所述多个字段中的相同字段或不同字段。
在一些实施例中,所述模型训练程序的配置信息还包括:模型训练程序所属项目的信息和所属项目在源代码管理仓库中的地址;
所述文件生成单元基于所述模型训练程序的配置信息生成配置文件还包括:将所述模型训练程序所属项目的信息和所属项目在源代码管理仓库中的地址写入所述多个字段中的相同字段或不同字段。
在一些实施例中,所述模型训练程序的配置信息还包括:模型训练程序使用说明的文本信息;
所述文件生成单元基于所述模型训练程序的配置信息生成配置文件还包括:将所述文本信息写入所述多个字段中的一个字段。
在一些实施例中,所述获取单元还用于获取模型训练程序使用说明的文件;所述文件生成单元还用于基于所述模型训练程序使用说明的文件生成一个或多个第三层文件;
相应地,所述描述文件中还包括:所述一个或多个第三层文件的描述信息;所述模型训练程序镜像中还包括所述一个或多个第三层文件。
在一些实施例中,所述镜像生成单元用于:
基于容器镜像标准,将所述描述文件、所述配置文件、所述一个或多个第一层文件和所述一个或多个第二层文件打包为模型训练程序镜像。
在一些实施例中,所述模型训练程序的配置信息定义在所述模型训练程序文件中;
相应地,所述获取单元获取所述模型训练程序的配置信息包括:解析所述模型训练程序文件,得到所述模型训练程序的配置信息。
第三方面,本公开实施例还提出一种电子设备,包括:处理器和存储器;所述处理器通过调用所述存储器存储的程序或指令,用于执行如第一方面任一实施例所述方法的步骤。
第四方面,本公开实施例还提出一种非暂态计算机可读存储介质,用于存储程序或指令,所述程序或指令使计算机执行如第一方面任一实施例所述方法的步骤。
可见,本公开的至少一个实施例中,通过基于模型训练程序文件和数据集生成不同的层文件,并基于配置信息生成配置文件,进而可生成用于描述这些层文件和配置文件的描述文件,从而将生成层文件、配置文件和描述文件生成为模型训练程序镜像,实现了模型训练程序的统一打包格式规范,便于模型训练程序在各个机器学习平台进行迁移、训练、使用等。
另外,本公开的至少一个实施例中,模型训练程序镜像通过扩展开放容器标准(Open Container Initiative,OCI)实现将模型训练程序打包成镜像,便能同时解决掉打包格式统一、程序依赖、使用说明、标签等问题。此外,借助于大量存在的OCI镜像存储设施完成模型训练程序的分发和共享,解决目前难以分发和共享模型训练程序的问题。
附图说明
为了更清楚地说明本公开实施例的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本公开的一些实施例,对于本领域普通技术人员来讲,还可以根据这些附图获得其他的附图。
图1是本公开实施例提供的一种模型训练程序镜像的生成方法的示例性流程图;
图2是本公开实施例提供的一种模型训练程序镜像的生成装置的示例性框图;
图3是本公开实施例提供的一种电子设备的示例性框图。
具体实施方式
为了能够更清楚地理解本公开的上述目的、特征和优点,下面结合附图和实施例对本公开作进一步的详细说明。可以理解的是,所描述的实施例是本公开的一部分实施例,而不是全部的实施例。此处所描述的具体实施例仅仅用于解释本公开,而非对本公开的限定。基于所描述的本公开的实施例,本领域普通技术人员所获得的所有其他实施例,都属于本公开保护的范围。
需要说明的是,在本文中,诸如“第一”和“第二”等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。
针对目前对模型训练程序缺乏统一的格式规范,模型训练程序很难迁移到不同的机器学***台进行迁移、训练、使用等。
另外,针对目前缺乏有效的模型训练程序打包和分发机制,无法将模型训练程序共享出来供其他开发者使用的问题,以及目前各个模型训练程序缺乏有效的方式同时解决注明标签、使用说明文档、程序依赖、存储分发共享等问题,本公开实施例中模型训练程序镜像通过扩展开放容器标准(Open Container Initiative,OCI)实现将模型训练程序打包成镜像,便能同时解决掉打包格式统一、程序依赖、使用说明、标签等问题。此外,借助于大量存在的OCI镜像存储设施完成模型训练程序的分发和共享,解决目前难以分发和共享模型训练程序的问题。
图1为本公开实施例提供的一种模型训练程序镜像的生成方法的示例性流程图。该方法的执行主体为电子 设备,电子设备可以理解为机器学***台无关的设备。在一些实施例中,电子设备可以为智能手机、平板电脑,笔记本电脑等移动设备,也可以为个人台式计算机、服务器等固定设备,其中,服务器可以为单个服务器,也可以为服务器群组,服务器群组可以是集中式的,也可以是分布式的。为便于描述,以下实施例中以电子设备为执行主体说明模型训练程序镜像的生成方法的流程。
在步骤101中,电子设备获取模型训练程序文件、数据集和模型训练程序的配置信息。其中,数据集可包括用于训练模型的训练数据和用于测试模型的测试数据。具体地,模型训练程序可基于训练数据训练模型,并基于测试数据测试训练后的模型。
在一些实施例中,电子设备可提供用户界面(User Interface,UI),以便用户可通过该UI输入模型训练程序的配置信息。在一些实施例中,模型训练程序文件和/或数据集可在本地获取,也可通过网络远程获取。
在一些实施例中,模型训练程序的配置信息可定义在模型训练程序文件中。相应地,电子设备获取模型训练程序的配置信息包括:解析模型训练程序文件,得到模型训练程序的配置信息。
在一些实施例中,电子设备还可获取模型训练程序使用说明的文件。模型训练程序使用说明的文件可以是图片,也可以是文档。
在步骤102中,电子设备基于模型训练程序文件生成一个或多个第一层文件。其中,层文件的定义借用容器镜像标准中的层(Layer)文件的定义,不再赘述,其中,容器镜像标准例如为OCI标准中的容器镜像标准(Image Spec)。本实施例扩展了容器镜像标准中的Layer。
在一些实施例中,模型训练程序文件为可执行文件,机器学习平台中的操作***可直接加载执行该可执行文件。电子设备用一个Layer放该可执行文件,具体地,电子设备基于该可执行文件生成一个第一层文件。
在一些实施例中,模型训练程序文件为模型训练程序的源代码文件和依赖文件,其中,依赖文件包括:模型训练程序在训练过程中所依赖的一个或多个文件。在一些实施例中,电子设备基于源代码文件生成一个第一层文件,并基于依赖文件生成一个或多个第一层文件,其中,基于依赖文件生成的第一层文件的数量,取决于依赖文件中包括的子文件的数量。本实施例中,电子设备用一个Layer放源代码文件,用一个或多个Layer放依赖文件。
在一些实施例中,依赖文件中有多个子文件,每个子文件可分别放在不同的Layer中,或,部分子文件可放在相同的Layer中,或,全部子文件放在同一个Layer中。
在步骤103中,电子设备基于数据集生成一个或多个第二层文件。本实施例扩展了容器镜像标准中的Layer。在一些实施例中,基于数据集包括测试数据和训练数据,电子设备针对测试数据生成一个或多个第二层文件,且针对训练数据生成一个或多个第二层文件。本实施例中,电子设备针对测试数据和训练数据,分别采用一个或多个Layer来存放,Layer数量可基于数据量来确定。
在一些实施例中,电子设备可基于获取的模型训练程序使用说明的文件,生成一个或多个第三层文件。本实施例扩展了容器镜像标准中的Layer。例如,模型训练程序使用说明的文件是文档,那么电子设备可用一个Layer放该文档,具体地,电子设备基于该文档生成一个第三层文件。又例如,模型训练程序使用说明的文件包括多张图片,那么电子设备基于这多张图片,生成一个或多个第三层文件,其中,第三层文件的数量取决于模型训练程序使用说明的文件中包括的图片的数量。
在一些实施例中,模型训练程序使用说明的文件包括多张图片,每张图片可分别放在不同的Layer中,或, 部分图片可放在相同的Layer中,或,全部图片放在同一个Layer中。
在步骤104中,电子设备基于模型训练程序的配置信息生成配置文件。其中,配置文件类似于容器镜像标准中的Config文件。本实施例扩展了容器镜像标准中的Config文件。在一些实施例中,模型训练程序的配置信息可包括但不限于:场景、参数定义和调用方法。其中,场景与机器学习所要解决的问题相关。
在一些实施例中,若机器学习所要解决的问题是二分类问题,具体地,根据数据样本上抽取出的特征,判定其属于有限个类别中的哪一个。比如:垃圾邮件识别(结果类别:1、垃圾邮件;2、正常邮件),那么场景为垃圾邮件分类场景。
在一些实施例中,若机器学习所要解决的问题是回归问题,具体地,根据数据样本上抽取出的特征,预测一个连续值的结果。比如:某个电影的票房预测,那么场景为票房预测场景。
在一些实施例中,若机器学习所要解决的问题是聚类问题,具体地,根据数据样本上抽取出的特征,让样本抱团(即相近/相关的样本在一团内)。比如:新闻分类,那么场景为新闻聚类场景。
在一些实施例中,电子设备生成的配置文件包括多个字段。电子设备可将配置信息中的场景写入一个字段,例如,电子设备可将配置信息中的场景写入标签(label)字段中,其中,label字段类似于Config文件中的label字段,具体地,在label字段中,场景为键值对,比如:senario=classification,这个键值对表示场景为二分类场景。
电子设备可将配置信息中的参数定义和调用方法写入相同字段或不同字段。例如,电子设备可将参数定义和调用方法写入相同字段:元信息(meta)字段。其中,meta字段类似于Config文件中的meta字段,但写入的内容不相同。在一些实施例中,在meta字段中还可以写入模型训练程序的相关信息,相关信息例如为文本信息,该文本信息为模型训练程序使用说明的文本信息,用于说明模型训练程序如何使用。
在一些实施例中,模型训练程序的配置信息还可包括但不限于:模型训练程序所属项目的信息和所属项目在源代码管理仓库中的地址。其中,模型训练程序所属项目的信息例如为项目主页,所属项目在源代码管理仓库中的地址例如为Github地址。
在一些实施例中,电子设备可将模型训练程序所属项目的信息和所属项目在源代码管理仓库中的地址写入配置文件多个字段中的相同字段或不同字段。例如,电子设备可将模型训练程序所属项目的信息和所属项目在源代码管理仓库中的地址均写入meta字段中。
在一些实施例中,模型训练程序的配置信息还可包括但不限于:模型训练程序使用说明的文本信息。电子设备可将该文本信息写入配置文件多个字段中的一个字段,例如meta字段中。
在一些实施例中,配置文件的多个字段中包括注解(annotation)字段,其中,annotation字段类似于Config文件中的annotation字段。电子设备可在annotation字段中写入注明信息、备注信息等便于用户了解模型训练程序的信息。在一些实施例中,配置文件的多个字段中还可包括镜像创建信息的相关字段,例如作者字段,创建时间字段等。在一些实施例中,注明信息、备注信息等便于用户了解模型训练程序的信息可定义在模型训练程序文件中。相应地,电子设备可解析模型训练程序文件,获取注明信息、备注信息等,进而将这些信息写入到annotation字段中。
在步骤105中,电子设备生成描述文件,描述文件中包括:配置文件的描述信息、一个或多个第一层文件的描述信息和一个或多个第二层文件的描述信息。在一些实施例中,电子设备若基于获取的模型训练程序使用 说明的文件,生成一个或多个第三层文件,则电子设备生成的描述文件中还包括:一个或多个第三层文件的描述信息。在一些实施例中,描述文件类似于容器镜像标准中的Manifest文件。
在步骤106中,电子设备生成模型训练程序镜像,模型训练程序镜像中包括描述文件、配置文件、一个或多个第一层文件和一个或多个第二层文件。在一些实施例中,电子设备若基于获取的模型训练程序使用说明的文件,生成一个或多个第三层文件,则电子设备生成的模型训练程序镜像中还包括:一个或多个第三层文件。
在一些实施例中,电子设备基于容器镜像标准,将描述文件、配置文件、一个或多个第一层文件和一个或多个第二层文件打包为模型训练程序镜像。在一些实施例中,电子设备若基于获取的模型训练程序使用说明的文件,生成一个或多个第三层文件,则电子设备基于容器镜像标准,将描述文件、配置文件、一个或多个第一层文件、一个或多个第二层文件和一个或多个第三层文件打包为模型训练程序镜像。
这样,模型训练程序镜像为采用统一的打包格式规范打包的镜像,便于模型训练程序在各个机器学习平台进行迁移、训练、使用等,实现“一处书写到处训练”的目标。
另外,模型训练程序镜像为通过扩展开放容器标准(Open Container Initiative,OCI)将模型训练程序打包成的镜像,具体地,本公开至少一个实施例中扩展了OCI标准中的Config文件和Layer。便能同时解决掉打包格式统一、程序依赖、使用说明、标签等问题。此外,借助于大量存在的OCI镜像存储设施完成模型训练程序的分发和共享,解决目前难以分发和共享模型训练程序的问题。
在一些实施例中,电子设备可通过类似Docker Build的命令行工具,来完成模型训练程序镜像的创建工作。模型训练程序镜像与应用容器引擎(Docker)镜像完全兼容,能直接作为Docker镜像使用,使用方便,也能作为普通Docker镜像进行分发和存储。
需要说明的是,对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员能够理解,本公开实施例并不受所描述的动作顺序的限制,因为依据本公开实施例,某些步骤可以采用其他顺序或者同时进行。另外,本领域技术人员能够理解,说明书中所描述的实施例均属于可选实施例。
图2为本公开实施例提供的一种模型训练程序镜像的生成装置的示例性框图。如图2所示,生成装置可包括但不限于:获取单元21、文件生成单元22和镜像生成单元23。各单元具体说明如下:
获取单元21,用于获取模型训练程序文件、数据集和模型训练程序的配置信息;
文件生成单元22,用于基于模型训练程序文件生成一个或多个第一层文件;基于数据集生成一个或多个第二层文件;基于模型训练程序的配置信息生成配置文件;生成描述文件,描述文件中包括:配置文件的描述信息、一个或多个第一层文件的描述信息和一个或多个第二层文件的描述信息;
镜像生成单元23,用于生成模型训练程序镜像,模型训练程序镜像中包括描述文件、配置文件、一个或多个第一层文件和一个或多个第二层文件。
在一些实施例中,模型训练程序文件为模型训练程序的可执行文件;
文件生成单元22基于模型训练程序文件生成一个或多个第一层文件包括:基于可执行文件生成一个第一层文件。
在一些实施例中,模型训练程序文件为模型训练程序的源代码文件和依赖文件;其中,依赖文件包括:模型训练程序在训练过程中所依赖的一个或多个文件;
文件生成单元22基于模型训练程序文件生成一个或多个第一层文件包括:基于源代码文件生成一个第一 层文件;基于依赖文件生成一个或多个第一层文件。
在一些实施例中,数据集中包括测试数据和/或训练数据;
文件生成单元22基于数据集生成一个或多个第二层文件包括:针对测试数据生成一个或多个第二层文件;针对训练数据生成一个或多个第二层文件。
在一些实施例中,模型训练程序的配置信息包括:场景、参数定义和调用装置;配置文件包括多个字段;
文件生成单元22基于模型训练程序的配置信息生成配置文件包括:
将场景写入多个字段中的一个字段;
将参数定义和调用装置写入多个字段中的相同字段或不同字段。
在一些实施例中,模型训练程序的配置信息还包括:模型训练程序所属项目的信息和所属项目在源代码管理仓库中的地址;
文件生成单元22基于模型训练程序的配置信息生成配置文件还包括:将模型训练程序所属项目的信息和所属项目在源代码管理仓库中的地址写入多个字段中的相同字段或不同字段。
在一些实施例中,模型训练程序的配置信息还包括:模型训练程序使用说明的文本信息;
文件生成单元22基于模型训练程序的配置信息生成配置文件还包括:将文本信息写入多个字段中的一个字段。
在一些实施例中,获取单元21还用于获取模型训练程序使用说明的文件;
文件生成单元22还用于基于模型训练程序使用说明的文件生成一个或多个第三层文件;
相应地,描述文件中还包括:一个或多个第三层文件的描述信息;模型训练程序镜像中还包括一个或多个第三层文件。
在一些实施例中,镜像生成单元23用于:
基于容器镜像标准,将描述文件、配置文件、一个或多个第一层文件和一个或多个第二层文件打包为模型训练程序镜像。
在一些实施例中,模型训练程序的配置信息定义在模型训练程序文件中;
相应地,获取单元21获取模型训练程序的配置信息包括:解析模型训练程序文件,得到模型训练程序的配置信息。
模型训练程序镜像的生成装置的实施细节可参考行为模型训练程序镜像的生成方法各实施例,为避免重复描述,在此不再赘述。
在一些实施例中,模型训练程序镜像的生成装置中各单元的划分仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如可以将多个单元实现为一个单元;也可以将一个单元划分为多个子单元。可以理解的是,各个单元或子单元能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。本领域技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能。
图3是本公开实施例提供的一种电子设备的结构示意图。如图3所示,电子设备包括:至少一个处理器31、至少一个存储器32和至少一个通信接口33。电子设备中的各个组件通过总线***34耦合在一起。通信接口33,用于与外部设备之间的信息传输。可理解地,总线***34用于实现这些组件之间的连接通信。总线 ***34除包括数据总线之外,还包括电源总线、控制总线和状态信号总线。但为了清楚说明起见,在图3中将各种总线都标为总线***34。
可以理解,本实施例中的存储器32可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。
在一些实施方式中,存储器32存储了如下的元素,可执行单元或者数据结构,或者他们的子集,或者他们的扩展集:操作***和应用程序。
其中,操作***,包含各种***程序,例如框架层、核心库层、驱动层等,用于实现各种基础任务以及处理基于硬件的任务。应用程序,包含各种应用程序,例如媒体播放器(Media Player)、浏览器(Browser)等,用于实现各种应用任务。实现本公开实施例提供的模型训练程序镜像的生成方法的程序可以包含在应用程序中。
在本公开实施例中,处理器31通过调用存储器32存储的程序或指令,具体的,可以是应用程序中存储的程序或指令,处理器31用于执行本公开实施例提供的模型训练程序镜像的生成方法各实施例的步骤。
本公开实施例提供的模型训练程序镜像的生成方法可以应用于处理器31中,或者由处理器31实现。处理器31可以是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器31中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器31可以是通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
本公开实施例提供的模型训练程序镜像的生成方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件单元组合执行完成。软件单元可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器32,处理器31读取存储器32中的信息,结合其硬件完成方法的步骤。
本公开实施例还提出一种非暂态计算机可读存储介质,所述非暂态计算机可读存储介质存储程序或指令,所述程序或指令使计算机执行如模型训练程序镜像的生成方法各实施例的步骤,为避免重复描述,在此不再赘述。
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。
本领域的技术人员能够理解,尽管在此所述的一些实施例包括其它实施例中所包括的某些特征而不是其它特征,但是不同实施例的特征的组合意味着处于本公开的范围之内并且形成不同的实施例。
本领域的技术人员能够理解,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。
虽然结合附图描述了本公开的实施方式,但是本领域技术人员可以在不脱离本公开的精神和范围的情况下做出各种修改和变型,这样的修改和变型均落入由所附权利要求所限定的范围之内。
工业实用性
本公开的至少一个实施例中,通过基于模型训练程序文件和数据集生成不同的层文件,并基于配置信息生成配置文件,进而可生成用于描述这些层文件和配置文件的描述文件,从而将生成层文件、配置文件和描述文件生成为模型训练程序镜像,实现了模型训练程序的统一打包格式规范,便于模型训练程序在各个机器学习平台进行迁移、训练、使用等。
另外,本公开的至少一个实施例中,模型训练程序镜像通过扩展开放容器标准(Open Container Initiative,OCI)实现将模型训练程序打包成镜像,便能同时解决掉打包格式统一、程序依赖、使用说明、标签等问题。此外,借助于大量存在的OCI镜像存储设施完成模型训练程序的分发和共享,解决目前难以分发和共享模型训练程序的问题。

Claims (22)

  1. 一种模型训练程序镜像的生成方法,包括:
    获取模型训练程序文件、数据集和模型训练程序的配置信息;
    基于所述模型训练程序文件生成一个或多个第一层文件;
    基于所述数据集生成一个或多个第二层文件;
    基于所述模型训练程序的配置信息生成配置文件;
    生成描述文件,所述描述文件中包括:所述配置文件的描述信息、所述一个或多个第一层文件的描述信息和所述一个或多个第二层文件的描述信息;
    生成模型训练程序镜像,所述模型训练程序镜像中包括所述描述文件、所述配置文件、所述一个或多个第一层文件和所述一个或多个第二层文件。
  2. 根据权利要求1所述的方法,其中,所述模型训练程序文件为模型训练程序的可执行文件;
    所述基于所述模型训练程序文件生成一个或多个第一层文件包括:基于所述可执行文件生成一个第一层文件。
  3. 根据权利要求1或2所述的方法,其中,所述模型训练程序文件为模型训练程序的源代码文件和依赖文件;其中,所述依赖文件包括:所述模型训练程序在训练过程中所依赖的一个或多个文件;
    所述基于所述模型训练程序文件生成一个或多个第一层文件包括:基于所述源代码文件生成一个第一层文件;基于所述依赖文件生成一个或多个第一层文件。
  4. 根据权利要求1至3任一项所述的方法,其中,所述数据集中包括测试数据和/或训练数据;
    所述基于所述数据集生成一个或多个第二层文件包括:针对所述测试数据生成一个或多个第二层文件;针对所述训练数据生成一个或多个第二层文件。
  5. 根据权利要求1至4任一项所述的方法,其中,所述模型训练程序的配置信息包括:场景、参数定义和调用方法;所述配置文件包括多个字段;
    所述基于所述模型训练程序的配置信息生成配置文件包括:
    将所述场景写入所述多个字段中的一个字段;
    将所述参数定义和所述调用方法写入所述多个字段中的相同字段或不同字段。
  6. 根据权利要求5所述的方法,其中,所述模型训练程序的配置信息还包括:模型训练程序所属项目的信息和所属项目在源代码管理仓库中的地址;
    所述基于所述模型训练程序的配置信息生成配置文件还包括:
    将所述模型训练程序所属项目的信息和所属项目在源代码管理仓库中的地址写入所述多个字段中的相同字段或不同字段。
  7. 根据权利要求5或6所述的方法,其中,所述模型训练程序的配置信息还包括:模型训练程序使用说明的文本信息;
    所述基于所述模型训练程序的配置信息生成配置文件还包括:
    将所述文本信息写入所述多个字段中的一个字段。
  8. 根据权利要求1至7任一项所述的方法,其中,所述方法还包括:
    获取模型训练程序使用说明的文件;
    基于所述模型训练程序使用说明的文件生成一个或多个第三层文件;
    相应地,所述描述文件中还包括:所述一个或多个第三层文件的描述信息;所述模型训练程序镜像中还包括所述一个或多个第三层文件。
  9. 根据权利要求1至8任一项所述的方法,其中,所述生成模型训练程序镜像包括:
    基于容器镜像标准,将所述描述文件、所述配置文件、所述一个或多个第一层文件和所述一个或多个第二层文件打包为模型训练程序镜像。
  10. 根据权利要求1至9任一项所述的方法,其中,所述模型训练程序的配置信息定义在所述模型训练程序文件中;
    相应地,获取所述模型训练程序的配置信息包括:解析所述模型训练程序文件,得到所述模型训练程序的配置信息。
  11. 一种模型训练程序镜像的生成装置,包括:
    获取单元,用于获取模型训练程序文件、数据集和模型训练程序的配置信息;
    文件生成单元,用于基于所述模型训练程序文件生成一个或多个第一层文件;基于所述数据集生成一个或多个第二层文件;基于所述模型训练程序的配置信息生成配置文件;生成描述文件,所述描述文件中包括:所述配置文件的描述信息、所述一个或多个第一层文件的描述信息和所述一个或多个第二层文件的描述信息;
    镜像生成单元,用于生成模型训练程序镜像,所述模型训练程序镜像中包括所述描述文件、所述配置文件、所述一个或多个第一层文件和所述一个或多个第二层文件。
  12. 根据权利要求11所述的装置,其中,所述模型训练程序文件为模型训练程序的可执行文件;
    所述文件生成单元基于所述模型训练程序文件生成一个或多个第一层文件包括:基于所述可执行文件生成一个第一层文件。
  13. 根据权利要求11或12所述的装置,其中,所述模型训练程序文件为模型训练程序的源代码文件和依赖文件;其中,所述依赖文件包括:所述模型训练程序在训练过程中所依赖的一个或多个文件;
    所述文件生成单元基于所述模型训练程序文件生成一个或多个第一层文件包括:基于所述源代码文件生成一个第一层文件;基于所述依赖文件生成一个或多个第一层文件。
  14. 根据权利要求11至13任一项所述的装置,其中,所述数据集中包括测试数据和/或训练数据;
    所述文件生成单元基于所述数据集生成一个或多个第二层文件包括:针对所述测试数据生成一个或多个第二层文件;针对所述训练数据生成一个或多个第二层文件。
  15. 根据权利要求11至14任一项所述的装置,其中,所述模型训练程序的配置信息包括:场景、参数定义和调用装置;所述配置文件包括多个字段;
    所述文件生成单元基于所述模型训练程序的配置信息生成配置文件包括:
    将所述场景写入所述多个字段中的一个字段;
    将所述参数定义和所述调用装置写入所述多个字段中的相同字段或不同字段。
  16. 根据权利要求15所述的装置,其中,所述模型训练程序的配置信息还包括:模型训练程序所属项目的信息和所属项目在源代码管理仓库中的地址;
    所述文件生成单元基于所述模型训练程序的配置信息生成配置文件还包括:将所述模型训练程序所属项目的信息和所属项目在源代码管理仓库中的地址写入所述多个字段中的相同字段或不同字段。
  17. 根据权利要求15或16所述的装置,其中,所述模型训练程序的配置信息还包括:模型训练程序使用说明的文本信息;
    所述文件生成单元基于所述模型训练程序的配置信息生成配置文件还包括:将所述文本信息写入所述多个字段中的一个字段。
  18. 根据权利要求11至17任一项所述的装置,其中,
    所述获取单元还用于获取模型训练程序使用说明的文件;
    所述文件生成单元还用于基于所述模型训练程序使用说明的文件生成一个或多个第三层文件;
    相应地,所述描述文件中还包括:所述一个或多个第三层文件的描述信息;所述模型训练程序镜像中还包括所述一个或多个第三层文件。
  19. 根据权利要求11至18任一项所述的装置,其中,所述镜像生成单元用于:
    基于容器镜像标准,将所述描述文件、所述配置文件、所述一个或多个第一层文件和所述一个或多个第二层文件打包为模型训练程序镜像。
  20. 根据权利要求11至19任一项所述的装置,其中,所述模型训练程序的配置信息定义在所述模型训练程序文件中;
    相应地,所述获取单元获取所述模型训练程序的配置信息包括:解析所述模型训练程序文件,得到所述模型训练程序的配置信息。
  21. 一种电子设备,包括:处理器和存储器;
    所述处理器通过调用所述存储器存储的程序或指令,用于执行如权利要求1至10任一项所述方法的步骤。
  22. 一种非暂态计算机可读存储介质,所述非暂态计算机可读存储介质存储程序或指令,所述程序或指令使计算机执行如权利要求1至10任一项所述方法的步骤。
PCT/CN2021/141366 2020-12-24 2021-12-24 模型训练程序镜像的生成方法、装置、设备及存储介质 WO2022135592A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011553757.5 2020-12-24
CN202011553757.5A CN112579149B (zh) 2020-12-24 2020-12-24 模型训练程序镜像的生成方法、装置、设备及存储介质

Publications (1)

Publication Number Publication Date
WO2022135592A1 true WO2022135592A1 (zh) 2022-06-30

Family

ID=75139500

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/141366 WO2022135592A1 (zh) 2020-12-24 2021-12-24 模型训练程序镜像的生成方法、装置、设备及存储介质

Country Status (2)

Country Link
CN (1) CN112579149B (zh)
WO (1) WO2022135592A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112579149B (zh) * 2020-12-24 2024-01-30 第四范式(北京)技术有限公司 模型训练程序镜像的生成方法、装置、设备及存储介质
CN113886003A (zh) * 2021-08-18 2022-01-04 雾实(福建)科技有限公司 海洋卫星遥感数据挖掘模型调度方法、***、设备和介质

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109144661A (zh) * 2018-07-05 2019-01-04 杭州电子科技大学 一种基于docker的深度学习管理方法
CN110083334A (zh) * 2018-01-25 2019-08-02 北京顺智信科技有限公司 模型上线的方法及装置
CN110852449A (zh) * 2019-11-25 2020-02-28 北京百度网讯科技有限公司 模型迁移方法和电子设备
CN110928553A (zh) * 2019-10-16 2020-03-27 中国平安人寿保险股份有限公司 深度学习模型的部署方法、装置和***
CN111580926A (zh) * 2020-03-25 2020-08-25 中国平安财产保险股份有限公司 模型发布方法、模型部署方法、装置、设备及存储介质
CN111813814A (zh) * 2020-07-30 2020-10-23 浪潮通用软件有限公司 一种支持多种机器学习框架的通用模型管理方法和装置
US10867091B1 (en) * 2018-08-17 2020-12-15 Synopsys, Inc. Machine learning based power optimization using parallel training and localized data generation
CN112579149A (zh) * 2020-12-24 2021-03-30 第四范式(北京)技术有限公司 模型训练程序镜像的生成方法、装置、设备及存储介质

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110795089A (zh) * 2019-10-29 2020-02-14 中国建设银行股份有限公司 一种代码生成方法、装置、设备和存储介质

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110083334A (zh) * 2018-01-25 2019-08-02 北京顺智信科技有限公司 模型上线的方法及装置
CN109144661A (zh) * 2018-07-05 2019-01-04 杭州电子科技大学 一种基于docker的深度学习管理方法
US10867091B1 (en) * 2018-08-17 2020-12-15 Synopsys, Inc. Machine learning based power optimization using parallel training and localized data generation
CN110928553A (zh) * 2019-10-16 2020-03-27 中国平安人寿保险股份有限公司 深度学习模型的部署方法、装置和***
CN110852449A (zh) * 2019-11-25 2020-02-28 北京百度网讯科技有限公司 模型迁移方法和电子设备
CN111580926A (zh) * 2020-03-25 2020-08-25 中国平安财产保险股份有限公司 模型发布方法、模型部署方法、装置、设备及存储介质
CN111813814A (zh) * 2020-07-30 2020-10-23 浪潮通用软件有限公司 一种支持多种机器学习框架的通用模型管理方法和装置
CN112579149A (zh) * 2020-12-24 2021-03-30 第四范式(北京)技术有限公司 模型训练程序镜像的生成方法、装置、设备及存储介质

Also Published As

Publication number Publication date
CN112579149A (zh) 2021-03-30
CN112579149B (zh) 2024-01-30

Similar Documents

Publication Publication Date Title
Terzić et al. Development and evaluation of MicroBuilder: a Model-Driven tool for the specification of REST Microservice Software Architectures
WO2022135592A1 (zh) 模型训练程序镜像的生成方法、装置、设备及存储介质
US20160011905A1 (en) Composing and executing workflows made up of functional pluggable building blocks
US10353874B2 (en) Method and apparatus for associating information
US10673789B2 (en) Bot-invocable software development kits to access legacy systems
WO2021139184A1 (zh) 数据查询展示方法、装置、计算机***及可读存储介质
US20200401935A1 (en) Self-learning ontology-based cognitive assignment engine
CN112307122A (zh) 一种基于数据湖的数据管理***及方法
US8538980B1 (en) Accessing forms using a metadata registry
WO2023087721A1 (zh) 一种业务处理模型生成方法、装置、电子设备和存储介质
US10719488B2 (en) Configurable provider for layered repository
US11226832B2 (en) Dynamic generation of user interfaces based on dialogue
CN110888972A (zh) 一种基于Spark Streaming的敏感内容识别方法及装置
CN117033249B (zh) 一种测试用例生成方法、装置、计算机设备及存储介质
CN113761040A (zh) 数据库与应用程序双向映射方法、设备、介质及程序产品
CN109063059A (zh) 行为日志处理方法、装置及电子设备
US11449677B2 (en) Cognitive hierarchical content distribution
US11449797B1 (en) Secure machine learning workflow automation using isolated resources
Kiesel et al. The block interface: accessing digital product memories
US11972311B2 (en) Artificial intelligence based integration frameworks
US12041190B2 (en) System and method to manage large data in blockchain
US11599357B2 (en) Schema-based machine-learning model task deduction
US20220417044A1 (en) System and method to manage large data in blockchain
Mukherjee et al. Big data analytics with service-oriented architecture
US7720904B2 (en) Entity projection

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21909587

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21909587

Country of ref document: EP

Kind code of ref document: A1